|
downloadable shoot bubbles example game, onenterframe, collision detection, random placement (Math.random), shape tween, drag multiple objects |
In this tutorial you will learn how to create a small “shooting stars” game using Flash and ActionScript 3. Let's get started!
|
This tutorial will teach you how to create randomly shooting masks over an image. You will learn how to use multiple masks over an image and animating the alpha of the masks.
|
In this tutorial you will be learning how to make a simple shooting system that pauses between shots so it doesn't fire rapidly.
|
|
|
12 Free Online Quiz Creators for Teaching Online Last post by: Sunnyme Date: 01.10.2009 06:26:27
|
First of all, create a movie clip with what you want to shoot. I'll make a simple turret for this tut. Make sure the barrel (or what will do the shooting) is facing right and is horizontal (I'll explain later). Also, move it so that the turning point is under the "+" on the stage.
|
Hello , I agree with this article, just sometimes I read so fast everything and I miss things that after read them again, I can understand it better.. ;). Your g a Flash Shooter game like SkyForce: Part 1 | Its Not Another Gaming Site Blog Stumbled up and Bookmarked, so I keep updated on every article you write from now now on flash games.
|
Movement is simple enough. The arrow keys to move has always been the standard procedure and I’m not about to change that. There is one more symbol that I’ve used in the game this time around: SYMBOLS: shot: the symbol used for shots. This here is the code. I’ve explained all the lines I added this time around. The others are explained in part 1.
|
So its shooter time again. I’m back with part 3 where I’ve completed the prototype for the game. Whew!! You can Check out part 1 and part 2 also. |
shottime induces a gap in two shots.. basically a delay variable. 8. motionspeed is the speed of the scrolling background. 9. xmoved, I’ve used this variable to see how long the game has gone in order to spawn enemies at the right locations. 10. mlcounter is a countervariable for the number of missile launcher’s onscreen. 11. misslecount is another counter variable that’s counting the number of enemy missiles on screen. 12. xdist is an array, an enemy spawns whenever the ship has traveled the distance equal to an xdist value. (ie. If xmoved = xdist(i) then spawn enemy) 13. xplace is the x co-ordinate of a new missle launcher, its also an array. (could have made it random but I used an array) 14. attached the background scrolling screen 1 15. attached the other part of the background just above the first screen 16. created an empty movie called the shotmovie which will contain all instances of shots 17. created an empty movie called the enemies which will contain all instances of enemies 18. created an empty movie called the bonusmovie which will contain all bonuses 19. created an empty movie called missles which will contain all instances of missiles 20. attached the ship on screen and made it ship 21. the onenterframe function: this function executes each frame 22. called the function shipmover: Explanation of shipmover function 31. The definition of the shipmover function starts here. 32. increase ship._x according to the xpseed value 33. increase the ship._y according to yspeed value 34 to 45 : Stopping the ship from going of screen borders. 46 and 47. Lowering the x and y speeds according to friction. 48 to 53: changing the yspeed variable according to up and down arrow key presses 54 to 61: Doing the same with xspeed, but also changing the turntest value so as to detect horizontal motion 62 to 66: animating horizontal motion if detected in previous section 67. Changing turntest back to 0 23 to 25: Resetting the xmoved value, this is essential for my prototype as I have only set a limited number of xdist and xplace array values. 26. Calling the shooter function Explanation of shooter function 80. The definition of shooter function starts here 81. Decrementing the shottime. 82. This if block runs every time shottime becomes zero 83 to 85: If shotcount reaches seven it’s reset. 86. Shottime reset to 10 87. created a new movie called shot[i] where i is the value of the shotcount, and attached it to the empty movieclip shots. 88. Incremented shotcount 89. declared shot speed = 8 90. The function executed in this instance of shot everytime it enters a frame 91. Its y co-ordinate is changed according to its speed. 92 to 94. If the shot moves off screen, its removed.
|
If you double click on your knight movie clip, you should be in the timeline for that movie clip. You will see three layers corresponding to the body, arms, and legs:
|
|
|
|
Mail (will not be published) |
Mail (will not be published) |
|
Thats it, Now press Ctrl+T to test in player and press the Ctrl button to fire the weapon from the ship. |
|
We use getTimer() function to save the time this shot was fired in the lastshot property. |
|
|
|
|
This is the third tutorial of a series about developing a Space Shooter game, in this tutorial we are going to make enemy ships. |
This is the forth part of the development of a Space Shooter game. In this tutorial we will add lives, scores and game over to our game. |
The "depth" is in which "layer" the new MC instance is made, because of that we can't have two instances of "Bullet" with the same depth or one would overwrite the other. So we use _root.getNextHighestDepth() and flash automatically gets a free depth for us. |
|
|
|