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! / Sentry type anim

Author
Message
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 4th Oct 2004 05:08
I have spent hours working on this simple anim and can't seem to get it right.
Imagine a sentry at X100 on your screen, he turns to his left(30 frames), walks to the right (30frames repeated) until he reaches X500, Turns to his right (30 frames) and marches to the left,(30 frames repeated)until he reaches X100, then repeats itself.
Sounds straight forward, but when I Code "if x>500" to get it to turn at that point, the rest wont work because X needs to be >500 and I cant find any other way of commanding it to turn at that point. I am using images I created in Poser so it would not be much help if I sent the Code.

OldWrinkly
Blue Shadow
22
Years of Service
User Offline
Joined: 6th Feb 2004
Location:
Posted: 4th Oct 2004 05:15 Edited at: 4th Oct 2004 05:15
Im not sure if this would work (or if this is what you are looking for) but how about creating a sprite at x500 and then if it collides with that the get it to turn.

Just my 2 cents,

Code Monkey
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 4th Oct 2004 17:11
Thanks code monkey, will have a go, never thought of that one.

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 03:55
It took me a couple of monthes to sort this one and make it accurate.
The problem was "Stopping the sprite at each end" So I could run the "Turn around animation" without it sliding.
And the other was getting it to continue, once it had done one run.
I did use Code monkey's sugestion, with "Collision" by putting a hidden wall sprite at each end and through trial and error over six Weeks, it is finaly done.
I now have a precious piece of code to use for other purposes.
This was done for DBC
Sprites are in .JPG format. Convert to BMP. Before using.
If I've made a mess of getting the Graphics to you, Sorry O.W.

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 03:58
Here is Turn right

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 03:59
Here is run right

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 04:00
Here is Runleft

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 04:04
and here is the crashbar
The names of the files are slightly different to those in the code so could you change before using, sorry.

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 28th Oct 2004 04:06
sorry messed up again, here's Turnleft

OldWrinkly
Old Wrinkly
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: Nth Devon UK
Posted: 30th Oct 2004 01:48
Seem to have got a white line through graphic, just wipe it out with black

OldWrinkly

Login to post a reply

Server time is: 2026-06-11 17:33:41
Your offset time is: 2026-06-11 17:33:41