Got my Engine Woprkin..but how to i display units?

Started by
12 comments, last by Woody FX 22 years, 1 month ago
Hmm, thought I removed the defines... Strange that there were no line breaks... Ah, never mind.

First, get into some image-program. Then draw all of your frames in different images. Then create a tall image and paste the old images right under each other. A long serie-strip, in the other direction.

About loadCrap(), or a better suited name, loadPic(). This just loads an image, like you have always loaded a .bmp or whatever. Nothing strange in this one.

Say we only have one picture for every direction of the figure, south, west, north and east in that particular order. If the player is walking to the south, we draw the picture from offset "picpointer+0". If the player walks to the left, we draw the west picture from "picpointer+picsize". And so on. Since the big image with all smaller pictures is stored in tall strip, a simple scanline-copying method of drawing the pictures will suffice.

Now, onto the animation. Say we have two frames per direction (_yuk!_). Then we store each group of frames for a special direction after eachother. If the player is walking south, we cycle through the first and second pictures, right? If the player walks to west, we draw picture #3-4! Get it?

I don''t see why or how the program needs to know this. If all characters in the game have a picture-list like the above (groups of frames stored under eachother), the same procedure can be used for all characters.

If you really need some code on this, tell me and I''ll try to hack something together.
Advertisement
If you have something handy i wouold apprecate it...but dont go killin your self over it!

You are a star!

Doylo
Don''t count on getting it very soon... I must fix my computer, got a job to do, then I''m going to a LAN during the weekend. But I''ll try write something together as quick as I can.
Thanks alot....

Brian

This topic is closed to new replies.

Advertisement