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! / Trying to make a Manual Animator

Author
Message
Megaman X Gold
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location: Canada
Posted: 30th Jun 2003 18:12 Edited at: 30th Jun 2003 18:13
Since "create sprite animation" is an unreliable way of creating my sprite animations as far as it seems (with that horrible blur) I figured that maybe I could program up my own manual animator. Well...it doesn't work, and I assume I just don't understand the timer() function as much as I had hoped.

Now I know my code is in great error and probably should never work...but I am posting it here in case it inspires any ideas for anyone. If so, please report back to me? Thankies.

(posting code in source code button below)

Life is more like a box of Grenades. Throw the pin instead of the grenade, and it blows up in your face...along with the rest still beside you.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 30th Jun 2003 19:08
you only need 1 sprite then just change the image number acording to how much time has gone by

hi guys
Megaman X Gold
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location: Canada
Posted: 30th Jun 2003 20:25 Edited at: 30th Jun 2003 20:28
Thanks...but I'm an idiot and I still don't understand how the timer works nor what I'm doing wrong. I wanted to be able to use something I wrote to make this work, but I'm not smart enough. lol. I'll just have to use that other script which I believe was written by Raven. *tear*

Anyways...here's the new script that I made (started it over after I read what you said)

PS: In my last post I tried to set the timer() as a non-integer, and I forgot it was counted in milliseconds instead of seconds. So I fixed that in this new script, while it works...just as much as the other one did. (sprite doesn't move, let alone animate...and the starting sprite is always blurry, which is just so strange)

Life is more like a box of Grenades. Throw the pin instead of the grenade, and it blows up in your face...along with the rest still beside you.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 1st Jul 2003 00:01
you don't need all the sync's just one before the 'loop' will be fine. the timer() is a much bigger number than 1000 or 3000 as it is the internal system time(or something???) so your code won't work, i'll try and fix your code/ show you a working example tommorow as i am tired now. you are using dark basic classic right???

hi guys
Megaman X Gold
20
Years of Service
User Offline
Joined: 29th Jun 2003
Location: Canada
Posted: 1st Jul 2003 02:11
No, DarkBASIC Pro.

Life is more like a box of Grenades. Throw the pin instead of the grenade, and it blows up in your face...along with the rest still beside you.
Algae Man
21
Years of Service
User Offline
Joined: 11th Nov 2002
Location: Canada
Posted: 4th Jul 2003 21:51
Don't use the timer functions for animation, as they just complicate things. Instead, make a variable (let's say t) and each time you go through the loop, increment it. Once it gets to a certain value, like 10, change the sprite image and set t back to zero.

Example (assuming that each frame of your sprite is a different image, 1,2,3,4,5,etc.):

a=1

do

sprite 1,sprite x,sprite y,a

t=t+1

if t=10
a=a+1
t=0
endif

sync
loop



a is the image number. t is the time variable. If you want a longer/shorter pause between each frame, adjust the number in the statement, if t=10. Hope this helps.

Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 5th Jul 2003 01:28
If he really did want to use the timer() he could do:


I hear and I forget. I see and I remember. I do and I understand.
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 5th Jul 2003 03:06
Yes do use the timer()...Do not increment a variable! Incrementing a variable will be different on all computers, timer() will be accurate.

Time = Timer()+500


Do

If time<= Timer()

Time = Timer()+500..........(500 = Half a second)

Increase your animation frame here


Loop


Pincho.

Login to post a reply

Server time is: 2024-04-24 18:12:30
Your offset time is: 2024-04-24 18:12:30