Hit the bug - part 2
In this tutorial we will be adding finishing touches. First we will make the swatter move with the mouse
Make sure you click the swatter and only the swatter. Then hit F9
Type the following code
Make sure you click the swatter and only the swatter. Then hit F9
Type the following code
// onClipEvent(enterFrame) enables the code to run continuously //Mouse.hide() hides the mouse //_root._xmouse is the x coordinate of the mouse //this._x is the x coordinate of the swatter onClipEvent (enterFrame) { Mouse.hide(); this._x = _root._xmouse; this._y = _root._ymouse; }
For the next part I am only giving tips, after all how will you learn if you always follow tutorials??
TO make the game better you can follow the following tips
Finally You can publish the game , add scoring system , advertisements etc into your game. See the next tutorial on how to do this
TO make the game better you can follow the following tips
- Tip 1 : Make a scoring system - When the player kills a bug, he gets points and vice versa. For this al you need to do is to create a variable called score and increment it every time a bug is killed ( score++ ) . And every time a bug is not killed you get minus points ( score-- )
- Tip 2 : Increase the speed of the game as the level increases. This can be done by decreasing the value of the speed variable in the previous tutorial.
- Tip 3 : You can add other features like Score bonus, time etc .
- Tip 4 : To make the game more difficult you can make the bug get smaller if you miss hitting it. This can be done by reducing the height and width of the bug( See gaming basics )
Finally You can publish the game , add scoring system , advertisements etc into your game. See the next tutorial on how to do this