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! / small anim, big headache. please help

Author
Message
old rinkly
22
Years of Service
User Offline
Joined: 11th Mar 2004
Location: Devon UK
Posted: 25th Feb 2007 23:36
Have problems with small part of a bigger animation. Explanation with the code.[code)
Rem Project: SpriteTesting2
Rem ***** Main Source File *****
set display mode 960,600,32
create animated sprite 54,"mrs ruin.png",8,5,1

` Set the x and y variables
MRX#=-51:MRY#=235
` Set the movement amount
X#=0.15
Y#=0.0
` Set the starting frames
M3=1:M4=8
time=0


do

sprite 54,MRX#,MRY#,1
play sprite 54,M3,M4,150
MRX#=MRX#+X#
MRY#=MRY#+Y#

if MRX#>305 and MRX#<307:M3=9:M4=16:set sprite frame 54,9:Y#=-0.15:endif
if MRY#<100:M3=17:M4=24:set sprite frame 54,17:Y#=0.0:X#=0.0:inc time:endif

if time>500:M3=25:M4=32:X#=0.0:Y#=0.0:endif
if time>1000:Y#=0.15:X#=-0.15:time=1100:endif

if MRY#>236 and MRY#<240:M3=1:M4=8:Y#=0.0:X#=0.15:endif

loop
rem this is a small part of a larger animation, walking in from the left on a footpath
`turning left on another footpath, stopping to watch another animation
`turning arround and walking back down the path, then off to the right.
Rem SIMPLE?, it has driven me nuts for such a small thing and makes me long for Amos Pro and Amal.
rem you can see where the animation goes wrong
Rem Have messed about with Variable "time", this only made things worse.
rem have tried to use "set sprite frame", this only froze the anims.
rem they are waiting outside with the straight jacket,please don't let them in.
rem Only joking, but it has given me some trouble.

old rinkly
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Feb 2007 02:24
I get an error when trying to run the code :S says something with unknown sprite error.

The byte chrunchers are coming...
Cybermind
Valued Member
23
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 27th Feb 2007 02:27 Edited at: 27th Feb 2007 02:40
nevermind, wasn't in the right folder could you explain your problem a little better? is she walking to fast upwards?

EDIT: I see the problem now, she does not turn around for walking donw, right?

The byte chrunchers are coming...
old rinkly
22
Years of Service
User Offline
Joined: 11th Mar 2004
Location: Devon UK
Posted: 27th Feb 2007 18:58
Right,she,s sliding backwards before walking down.
If I correct this with "set sprite frame" it doesn't animate.
I even altered the sprite sheet so everything is in the order it is used but that didn't help.
I have shelved that part of the main animation until I get a solution.
But would still appreciate any Ideas. Thanks

old rinkly
Quisco DaLuse
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: USA
Posted: 10th Mar 2007 18:37 Edited at: 15th Mar 2007 14:34
Old Rinkly, try this code:


It should work for you. I introduced the variable 'status' so that you could control when to change movement and animation.

For others trying this code, you will have to download the file in the first post and make sure it is in the same folder in which you save the code. It is a DB Pro file.

You idiots! You've captured their stunt doubles!

Login to post a reply

Server time is: 2026-07-05 00:30:28
Your offset time is: 2026-07-05 00:30:28