Animate actor

I'm making a basic elephant running game for my son, its my first game so it's really simple lol I just had a question about animating objects for example when the elephant gets to a tree I want him to jump up and make elephant sounds till he clicks and destroys the tree. So I'm thinking of uploading three or so different images that make it seem animated but how would I make the actor switch 3 or so times to make a fuss till the tree destroyed. It may sound simple but I'm really new lol

One more question! How to get the tree to just repeat after it's destroyed. Was their a tutorial on this?

Comments

  • JodyMitomaJodyMitoma Member Posts: 307
    edited May 2014

    Alright, here we go!

    First off, you're really sweet for taking the time to actually design a game strictly for your son's amusement. Parenting = Level 100,000.

    Now, lets get to it.

    To make an animation of an elephant running, you will have to use the ANIMATE behavior. Within the ANIMATE behavior, you will see a blank square. This is where you will place all the animation sequence images (.png's) of your animating elephant. Once you've got that taken care of, you can then choose how fast the images change by playing around with the frames per second. You'll probably want to leave Loop checked, but if you put all of the animation sequence images into the blank square, be sure to uncheck "revert back to original actor image".

    For the elephant to make a sound, you'll be using the PLAY SOUND behavior. Click on your elephant actor, and give it a RULE of "When 'elephant' collides or overlaps with 'tree', then PLAY SOUND". Drag and drop your sound file into the Media tab, then you'll be able to select it from a drop down list within PLAY SOUND.

    To make the elephant jump and stomp on the tree, or whatever else, you'll have to make a RULE to ANIMATE again, but this time, put in some images of the elephant jumping. There are multiple ways of making the elephant actually jump into the sky, one being fiddling with the .png's themselves, second being give the elephant a move/accelerate behavior, third being an instance, where the elephant actor will move up and down according to set TIME values you set, etc...

    Lastly, be sure to give the 'tree' a TOUCH Condition. Under the DO area, place a CHANGE ATTRIBUTE there... Before we go any further, add an "integer" into the "Game" that is called something along the lines of "treeHitCount". Now go into your 'tree' actor, and give it a RULE of If TOUCH is released, change "treeHitCount" to "treeHitCount+1". This will keep track of how many times your son has touched the tree, for the elephant to knock it down. Now give the 'tree' actor a RULE of "If game.treeHitCount >= 3", DO "DESTROY" Behavior (to make it disappear), or a "CHANGE IMAGE" Behavior if you have another image of the tree on the ground, broken due to excessive stompage from giant elephant.

    To get the tree to "repeat", use a SPAWN behavior. Check YouTube for videos on how to do this - as I've never had to use this behavior personally. ;)

    It's totally up to you at this point. The best of luck. Again, I applaud you for creating a video game for your child. You are an outstanding parent.

    To give you an idea of just how easy GameSalad is, I installed the software on my laptop on April 27th of this year; not but 15 days ago. You will learn extremely, extremely quickly - especially with the help of this amazing community.

  • Kittyclaws390Kittyclaws390 Member Posts: 27

    Thank you so much! I figured out a little more when I was on yesterday night, but your post helped answer all my questions. Love the kudos on parenting btw :p he's crazy about elephants and games are too hard, so yeah that's how I got here lol

  • JodyMitomaJodyMitoma Member Posts: 307

    @Kittyclaws390, you are very welcome. Let me know if you have any more questions. Just make sure to use the "@" symbol, and write my username, so that I know you replied. ;)

Sign In or Register to comment.