Isometric Game: The World Of The Ronics

General discussion for topics related to the FreeBASIC project or its community.
notthecheatr
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT
Contact:

Post by notthecheatr »

No, but it can load them with the help of fbpng, another free by-user for-user heavily used and tested FreeBASIC library :)
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Post by duke4e »

yep. there is a user made function called pload. do a little search on this forums, you can probably find anything you need.
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

yeah, i heard about Pload, now that you mentioned it; but how good does it work?
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Post by duke4e »

All FB PNG loaders I've tried worked awesome.
notthecheatr
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT
Contact:

Post by notthecheatr »

This is my favourite. All you have to do is

Code: Select all

#Include Once "\fbpng\fbpng.bi"
#Include Once "\fbpng\png_image.bi"
and then to load an image

Code: Select all

Dim As FB.Image Ptr myBuffer = png_load( "someImage.png", PNG_TARGET_FBNEW )
and to put it on the screen you use the standard fbgfx command

Code: Select all

Put (0, 0), myBuffer
(but of course you must first set the screen mode). Very simple, but very useful. You can also save PNGs with the same library, should you need to do that (for example to save screenshots).
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

fbpng is built into the Extended library as well, you can simply use:

Code: Select all

'init gfx mode first
var mypic = ext.LoadImage("image.png")
if you wanted to save a png, the function is now: ext.gfx.png.save(file)
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

Wow, thanks guys; i think i might end up using FB GFX and others like it...but can i get rid of a certain color (the color that's represents alpha, even though i think that png has its own alpha channel)
sir_mud
Posts: 1401
Joined: Jul 29, 2006 3:00
Location: US
Contact:

Post by sir_mud »

if you use the fbgfx command put with the modifier TRANS or ALPHA then any color that is hff00ff will not be drawn
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

Due to lack of planning, I must rebuild the engine almost from scratch.

Sorry for the news;
notthecheatr
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT
Contact:

Post by notthecheatr »

Ah, I know that feeling well... been there, done that.
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

yeah, i think most of the problem was that everything was too complex, which doesn't help in debugging the whole thing; and i have the habit of NOT commenting (any beginners reading this, heres a helpful tip; Comment your work! if you don't you'll end up in the same mess as me) my rewritten version will include more of a simple style...and hopefully comments in the engine so that when i set my engine out for others, they can learn from the code/edit any bugs easily.

is this a good habit: to test a new feature of the program/engine to the extreme?
notthecheatr
Posts: 1759
Joined: May 23, 2007 21:52
Location: Cut Bank, MT
Contact:

Post by notthecheatr »

Only test it as far as it needs to be tested. Also, a good principle I learned from anonymous1337 is to only write code for what you actually need. Don't bother adding features to your engine unless your game needs them. Which means, your engine should start out very simple and you develop the game itself alongside with the engine, at least in some form. Only as the game develops and needs special features should you add them to the engine. This will help you avoid wasting time and make things easier.
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

yeah, i wish i had that advice some time ago; I just erased 100+ lines of code that weren't used, or needed to be used; I'm almost done the cleaning the code; I'm still using SDL because it seems to fit lots of my needs. I'm also making my code in different files, so that is easy to debug problems and makes a cleaner looking code. well, I hope that I get where I was wanted to be last month, by the end of the week.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Post by duke4e »

100 lines of code is fairly small. imagine deleting few thousand lines of code, due the "human error".

also, what exactly do you need in your engine? i'm 100% sure that i can find anything you need in FB. for every "need" you write, i'll post a FB link to similar function.
ShadowLoneWolf
Posts: 33
Joined: Dec 18, 2007 1:34
Contact:

Post by ShadowLoneWolf »

I know that 100 is a small bit; thats because the error happened when the code was small.

at the current moment of time; the best thing i need is something to deal with sound, in WAV, OGG, and MP3. The rest I have to make myself because my maps exporter that I made needs to load a special format; But what would be nice is something to load a sprite sheet, and loads the sprite, and depending on the sprite action, it will get ready the next pic of the sprite;

All of this I can do, but the sound is the part I haven't learned yet, but i'm planning too; the one thing that i would love to learn, but in a later game i'll implant it, is networking (ie making a chat for people, and also sending information about the character location in the game, and his current status, etc)
Post Reply