Sprites and selective transitions?
teckner
Member Posts: 2
Hey people, I'm a very new developer-in both obj-c and gamesalad.
I was wondering if someone would tell me how I would go about doing this? I want to have one sprite to play, and if you drag/throw an object, a seperate random sprite (off a list) would start to play, then go back to the beginning after the second sprite is done playing.
I know it's alot to ask for with a newbie, but I'm shooting far...
Thanks
-Alex
I was wondering if someone would tell me how I would go about doing this? I want to have one sprite to play, and if you drag/throw an object, a seperate random sprite (off a list) would start to play, then go back to the beginning after the second sprite is done playing.
I know it's alot to ask for with a newbie, but I'm shooting far...
Thanks
-Alex
Comments
In order to do what I think you want to do, this is what I'd do:
Have player 1 animated by default
When you drag or throw that object, change an attribute you create to 1 (or something like that).
While that attribute is 1, change the animation on player 1 to the new animation.
Once the object is finished being dragged or thrown, change the attribute back to 0.
and when that attribute is 0, have the player 1 resume it's original animation.
You could do this with a few basic rules.
Player1:
RULE
When attribute game.action = 1
animate: (put the images for the 2nd animation here)
OTHERWISE
animate: (put the images for the original animation here)
Object
RULE
when object receives touch
change attribute game.action to 1
OTHERWISE
change attribute game.action to 0
You could even create the object's rule on a timer, so when you touch it the attribute changes to 1, and then after say 2 seconds, switch the value back.
anyways, that's how I'd do it.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Using attributes is the easiest way in my opinion, just like tshirtbooth said above. You'll have an attribute that gets a random number when you pick the actor off the pile. When that actor hits the player, the player will play a certain animation based on what that value is. then reset all the values and start again.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left