What we gonna do?
Running,
In the previous part we learned about walking and depths, now – running… And collisions.
READ MORE »
In the previous part we learned about walking and depths, now – running… And collisions.
READ MORE »
To begin the tutorial do the following:
First – Find a sprite sheet and import it into flash or draw the sprites
Second – Create a movie-clip with 4 frames, labelled; “left”, “up”, “right” and “down”
Third – Create movie-clips for each of the animations and place them on the appropriate frames in the appropriate place (feet should be on (0,0), the little + registration point)
Now, let’s begin coding…
READ MORE »
You may be familiar with full flash game tutorials… My last one was the movement one. But, it didn’t have a ‘full flash game’ at the end. Not a proper one anyway. This does. This tutorial ‘group’ will however allow you to make a ‘full flash game’.
“Role-playing game is a term used to describe a broad family of games in which players assume the roles of characters, or take control of one or more avatars, in a fictional setting. Actions taken within the game succeed or fail according to a formal system of rules and guidelines.”
Many games use the mouse as control because it’s easy to use. So to stay with the games market we need to be able to incorporate it into our work…
1 2 3 4 5 6 7 | onClipEvent (enterFrame) { difx = _root._xmouse-_x; dify = _root._ymouse-_y; Radians = Math.atan2(dify, difx); Degrees = 360*Radians/(2*Math.PI); _rotation = Degrees; } |
Line 1 : Opens a loop to constantly update the rotation
Line 2 : Finds the difference between the mouse’s and the objects x position
Line 3 : Finds the difference between the mouse’s and the objects y position
Line 4 : Works out the rotation in radians
Line 5 : Converts the radians to degrees
Line 6 : Set’s the rotation to the degrees
Line 7 : Exits loop
1 2 3 4 | onClipEvent(enterFrame){ this._x+=(_root._xmouse-this._x)/20 this._y+=(_root._ymouse-this._y)/20 } |
Line 1 : Opens a loop to constantly update the position
Line 2 : Find’s the difference in x positions, and adds it to it’s current position
Line 3 : Find’s the difference in y positions and adds it to it’s current position
Line 4 : Closes the loop
If and else statements are really common, if statement one is whatever to statement two, then do what you want or else do something else… The basic syntax is:
if (statement1 operator statement2){ //do something }
That is not brilliant because what is the operator. This is the part which checks the two statements:
• == If var1 is equal to var2
• >= If var1 is greater than or equal to var2
• > If var1 is greater than var2
• <= If var1 is smaller than or equal to var2
• < If var1 is smaller than var2
• != If var1 is NOT equal to var2
• && If var1 and var2 exist or both var1 and var2 are both set to true.
• || If either var1 and var2 exist and/or are set to true.
The above table lists the more common operators you will use. For the following examples, var1 and var2 are variables already initiated!
If, for example, you wanted to check if var1 is greater than var2 you would use the following code:
1 2 3 | if(var1>=var2){ //do something } |
But there we only check if it’s true, the else statement checks if it is not true…
1 2 3 4 5 | if(var1>=var2){ //do something } else { //do something else } |
Here if the first statement is correct it will do something otherwise it will do something else!
We have covered some basic code and some advanced code, here you can locate it all…
Part 1 – Thursday 7th January 2010
Part 2 – Friday 8th January 2010
Part 3 – Saturday 9th January 2010
Part 4 – Sunday 10th January 2010
Part 5 – Monday 11th January 2010
The demo uses four movieclips… The ball, the coin, the stick and the background.
So on the first frame of the timeline we use this code.
1 2 3 4 5 6 7 8 9 | save = SharedObject.getLocal("Stormation-Movement-Demo"); if (save.data.highScore == undefined){ _root.Ball.highScore = 0; }else{ _root.Ball.highScore = save.data.highScore; } _root.onEnterFrame = function(){ save.data.highScore = _root.Ball.highScore; } |
Here’s my demo of what can be made. Some adjustments have been made – some extra code but tomorrow i will release the code and sources
. Hopefully you realise the full potential of this full flash game tutorial. I know i don’t but hey – i bet you have a ton of ideas…
This, is really easy. All we need to know is the radius of the ball (half width), and we can just reverse the speed by using *= -1, but here i am going to use friction on the walls to enable much more realisticness (?!?, what’s the word?).
, anyhow here’s what i mean…
READ MORE »
So, as mentioned before – MORE WALLS
. We’ll be creating walls that are; speed related, angle related and other various nifty things.
This is easy
, no really VERY easy.
We just use a bit of maths and voila…
READ MORE »
EvoLve theme by Theme4Press • Powered by WordPress Stormation
Innovation through Creation - Flash | PHP | HTML | XML | CSS | SQL - By Eliott Robson
