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.

Newcomers DBPro Corner / need help with animated sprites

Author
Message
BULLSHOCK 2
Retired Moderator
19
Years of Service
User Offline
Joined: 14th Jun 2005
Location: Shocking Bulls
Posted: 9th Oct 2005 09:48
hey guys, i have tried really hard to undedrstand this...but i dont exactly get how animated sprites work in dbpro...could somebody explain it to me?

i tired the search function and the help files, but what i found wasnt very explainatory..

can anybody help?

X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 9th Oct 2005 13:37
hope this help


You can do it if you try
BULLSHOCK 2
Retired Moderator
19
Years of Service
User Offline
Joined: 14th Jun 2005
Location: Shocking Bulls
Posted: 10th Oct 2005 17:41
kindof...but i dont really understand how they move...is there a tutorial on them?

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Oct 2005 20:56
When you create an animated sprite it sets several images as the animation. When you write "play sprite 1,x,y,100" it places the sprite on the screen at the x and y location and shows the first frame of the animation. If x and y stay the same and don't change then the next time "play sprite" is ran it won't move but it will show the next frame of the animation. It's up to you to increase/decrease the x and y location to move the sprite.
BULLSHOCK 2
Retired Moderator
19
Years of Service
User Offline
Joined: 14th Jun 2005
Location: Shocking Bulls
Posted: 10th Oct 2005 22:15
ok so...

"play sprite 1,x,y,100"

then i get it to move by

"play sprite 1,x+10,y+10,100"

right?...ok ...i think i got it...it was really simple, now i feel dumb.

thanks so much!!!

Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Oct 2005 23:14 Edited at: 10th Oct 2005 23:35
If you do that it'll always be in the same place too.

Use either "x=x+10" or better yet "inc x,10" on a line under the play sprite command.

Edit: I decided to clarify more.

x and y are where you want the program to put the sprite.

Screens are like this (default is 640x480)

0,0---------------640,0
|
|
|
|
|
0,480------------640,480

So if you do this:


The first loop x=0 and y=300 so it puts the sprite at 0,300 on the screen. The next loop x is increased by 10 so x=10... so the sprite is placed at 10,300 (y did not change so it stays the same). Then x=20 and so on till it goes off the screen (it'll keep going till you hit esc).

Login to post a reply

Server time is: 2024-11-27 16:30:52
Your offset time is: 2024-11-27 16:30:52