How to load this tiled image..?
Blitz3D Forums/Blitz3D Beginners Area/How to load this tiled image..?
| ||
Well I don't really remember how to do it but here goes: I want to load this image [image removed] into an array, so I can choses which of the image is currently displayed, and how would I go about making the walking animation? Would you be kind enough to show me an example, just draw a rectangle where this char above can walk on it? That would be soo cool :) for the walking it should be something like that: [image removed] I dunno anything about platformer so Im practicing ;) Any tips on the other stuff like how gravity works and such.. |
| ||
You'd be better off using loadanimimage |
| ||
.......... I know that... Anyone with something more constructive? |
| ||
I want to load this image into an array... It sounded like you were implying the use of LoadImage and storing each frame in a element of an array. Seriously, take Perturbatio's advice and look up LoadAnimImage. In one command you can load that whole image into separate frames, and with a few more commands, you can draw them. There's a great example in the docs with LoadAnimImage. It's just what you were asking for. |
| ||
Thanks that was constructive ;) |
| ||
Dude, ask anyone that has some experience with B+. LoadAnimImage is so much faster, smaller, and simpler than storing each frame seperately. That just takes to long. Check out the Insectoids sample game that comes with B+. The explosions use LoadAnimImage, so look at the code and you'll get it. Even check out my game, Alien Invasion, at my website (see sig). That uses the same explosion code. If this isn't constructive enough for you, then I don't know what is. |
| ||
Thanks that was constructive ;) That wasnt sarcasm that was a real comment, cause it was constructive ;) |
| ||
Bad Image handler?AppTitle "mr" Graphics 640,480,16,2 Global SamusSprites = LoadAnimImage("images\SAMUS2.png",85,85,0,24) MaskImage SamusSprites,255,255,255 SetBuffer BackBuffer() Cls Repeat DrawImage SamusSprites,0,0,1 Flip Until KeyHit(1) |
| ||
Sorry about that Kaisuo I thought you were being sarcastic. Anyway that looks good, and I don't see a problem. Except it wont be animating because you keep using the same frame: Drawimage SamusSprites,0,0,1 You have to change the frame, so that it keeps going up, and goes back down to zero when it reaches the max. |
| ||
Rick it gives me a bad Handler Error :( |