How to make your own DEFEND YOUR CASTLE style game!

A lot of you should know the famous game called ‘Defend Your Castle’. if not, then go search it up on Google (or whatever search engine you use)!

You might think that it will be tough, but it’s not really!

This is how you do it:

  1. Create your flash document (optional… well… you have to make one to edit one!)

  2. Make (suprise) a Movie Clip. This will be the person.

  3. Double click on the MC (and wait for Flash to get into the MC if you use Windows Vista)

  4. Make two frames

  5. On the first frame, make a movie clip with your character running. On the other, your character dieing.

  6. Label the first frame ‘run’ and the other ‘die’.

  7. Give both frames the action ‘stop’.

  8. Now exit the MC (so there’s only ‘Scene 1’ shown at the top).

  9. Give the MC the instance name ‘enemy’ (no 's)

  10. Now give it this code:

on (release) {
gotoAndPlay (“die”);
}

This will take your character to the ‘die’ frame when clicked on.

  1. Now (on a new layer) draw the castle (it doesn’t have to be a castle… it can be anything you want!).

  2. Now tween your guy over from one side of the stage to the object you just drew.

  3. Now (on another new layer) make a static text box and write ‘Score’ (or whatever. It doesn’t have to be score. It can be ‘points’ or ‘Kill count’. Don’t add the 's though).

  4. now make a dynamic text box and type ‘0’ (no 's again). Make sure the alignment is in the middle.

  5. Now add this code at the start frame of the ‘die’ MC (in the ‘enemy’ MC):

_root.score.text++;

This adds a point to the score/kill count chart.

Finally, give the dynamic text box the instance name ‘score’ (once again, no 's).

Soz i don’t know how to do a health count. Maybe another time!

Now test your movie. Hooray! You now have a ‘Defend Your Castle’ style game!

if you want to see mine, go to swfup.com -> groups -> Invasion. It’s there (make sure the author is called Raffi_Stick)

P.S. I’m new here, and this is my first post, so don’t be too harsh.