Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / sprite animation help

Author
Message
Thequiet0ne
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 17th Oct 2004 08:08
anyone tell me how to go about animating this sprite??

Attachments

Login to view attachments
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 18th Oct 2004 04:18 Edited at: 18th Oct 2004 04:19
I've always wondered how to do that, since I'm acutally making my first (real)game now with sprites and stuff. I never got how u animate them. Do you get a gif file with a 100 frames containing walking, running and stuff like that, and then use frames 30-50 for one animation? or do u have to have a million gif files of every character doing a different animation?
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 18th Oct 2004 04:50
If you already have your images in memory with "Get Image".Say 30 of them.
Outside the " Do" "Loop", Put Sprite Number,Xpos,Ypos,Number 1 image.
In the Loop type Inc image:if image is>30:image =1:endif .
and your sprite will animate in a loop.see code
It's easier to look at the code and yo can see how to control the images for the anims and the X,Ys for the movement, hope this helps.
OLd Wrinkly
By the way, I have a code for cutting out your images from a bitmap, if it will help you

OldWrinkly
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 18th Oct 2004 07:20 Edited at: 18th Oct 2004 07:38
I also need help like figuring out what to put in the gif. (this is waht were supposed to use, rihgt >.> )


What if i put all of one cahracter's frames into one gif

And tell the game to use 1-3 as the walking animation

Do u understand what I'm trying to ask?

Quote: "By the way, I have a code for cutting out your images from a bitmap, if it will help you"
u mean like, from a sprite sheet?
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 19th Oct 2004 01:31
I understand what you need, but as I only use DB Classic, I only use Bitmaps.
In P.S.P. I make a blank Bitmap large enough to take all the images of, for instance a thirty frame walking left.
I put a grid on this, each section the size of each image, I then take each image in turn and snap them to the grid in order.
Either three tens, two fifteens or one thirty, depending on the size of your images.
Then I save this as a Bitmap with black as the background for transparency.
I do the same for every other part of the anim I need.
Then I use the following utility to cut them out and make your sprites.
I got this from DB a few years ago, juggled it a bit and have used it ever since, you will see how you can adapt it to your needs.
Just put in your figures.
I can't afford DB Pro so I don't Know if it runs in that.
I'm just an old Amos programmer realy, hoping to help anyone out while I'm still arround

OldWrinkly
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 20th Oct 2004 10:54
thanks, According to the manual you wont need to edit the code to make it work in DB Pro
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 20th Oct 2004 11:28 Edited at: 20th Oct 2004 11:29
it says line 26 has an illegal area in it....

here is the code:



BTW line 26 is the one that says:
get image 1+x+(y*c),(x*b),(y*a),(x*b)+b,(y*a)+a
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 21st Oct 2004 06:52
HI! on the line "number of rows-1 should read =0. as you only have 1 row of 7 sprites.
If I knew how to send you a complete prog together with some of my sprites, I would do so, but I,m not too familiar with the process.
Anyway, hope this helps.

OldWrinkly
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 21st Oct 2004 09:40 Edited at: 21st Oct 2004 09:40
thanks I'm so dumb sometimes I thought u meant that it is always one, lke when ur making a list >.>

Let me see if it works now

YES IT DOES! I even slowed it down so that it works at the right speed.

Thanks so much u've been a great help.

Attachments

Login to view attachments
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 21st Oct 2004 17:20
Thats OK, Your welcome

OldWrinkly
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 22nd Oct 2004 00:22
Oh by the way, If you are using this utility more than once in your code, don't forget to alter the "Get Image Number" to start at the end of the previous one.
In your case Get Image 8 and so on.

OldWrinkly
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 22nd Oct 2004 12:04
I know, but thanks for reminding me
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 23rd Oct 2004 11:11 Edited at: 24th Oct 2004 00:04
sorry to be a hassle, but It just stopped working all of a sudden.



I've attached the spritesheet too.

Never mind, Im using a different Image and now it works :s. I just have a problem for when u put more than one animation in a spritesheet.

Attachments

Login to view attachments
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 24th Oct 2004 00:16 Edited at: 24th Oct 2004 02:15
OldWrinkly wrote: "Oh by the way, If you are using this utility more than once in your code, don't forget to alter the "Get Image Number" to start at the end of the previous one.
In your case Get Image 8 and so on.

OldWrinkly"


Everytime i try that, it doesnt work.


here is the spritesheet i wan tto use the second image in the second line as the start.
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 29th Oct 2004 05:40
Sorry for not answering.
If you are going to use one sheet for a number of seperate animations, you cant use the code as it starts at 0,0.
You either have to cut them out the long winded way, one at a time, or make individual sheets for each anim.
It doesn,t matter if you don't have complete rows, for instance, 5 on the top and 4 on the bottom, for 9 sprites, it still works ok,
The only other way I have done it with a mixed lot of sprites on one sheet, is to cut them all of in their order and start and end with the image numbers of the anim you want.
If your short on memory, you can always delete the ones you don't want. Hope this helps.

OldWrinkly
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 30th Oct 2004 02:02
Left this reply in your other thread:
Hi. I see you have 66 images, Changing directions and what you want is to run say "Walk right" until you command it to change direction or turn etc.
Well what I do is cut out all the images Numbered 1 to 66.
Now make a variable ouside your loop "image=1".
Now in your loop you put " sprite 1,x,y, image"
Now if you just command "Inc image" it will run through the lot, which you dont want, so you do what I said previously,
If image>7 then image =1.
This as you know loops your first 7 from 1 to 7.
What you want is to change the animation to turn in any direction, so to do this you need to change the value of "image"
to the first number of the group you want.
So whatever you are using to command the turn, you out if "command":image = "the number you want":endif
and add the usual If image is more than"the last image"then image = "the first image".
I Know that if you are walking right and you want to turn right, you need to add the turn and the walk together during the turn so just experiment which looks best.
If you look below this, you will see a thread of mine "Sentry" have a read of this, it might help.
Best of luck.
I've downloaded your sprite sheet to make up some code, let you have it as soon as pos'

OldWrinkly
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 30th Oct 2004 07:27
Hi, here's the code I promised, just use your full sheet and use your curser keys.
You can ajust it and mess about with it as much as you like, it just gives you something to work on. All the Best.

OldWrinkly
They Killed Kenny
20
Years of Service
User Offline
Joined: 18th Jul 2004
Location: FL, USA
Posted: 30th Oct 2004 22:52 Edited at: 30th Oct 2004 23:03
thanks, it works u see im trying to makea simple real time strategy game, so i need to use the mouse as a controller i can put the mouse's coordinates in an array or a couple of variables, and then make the character move to that point when I clikc the mouse.
Old Wrinkly
22
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 30th Oct 2004 23:52
If I can help in the future, your welcome, By for now.

OldWrinkly

Login to post a reply

Server time is: 2025-05-15 22:37:13
Your offset time is: 2025-05-15 22:37:13