Friday, June 13, 2008

Adding mc speed using Numeric Stepper component

In previous example, our hero has constant speed set to 2. Speed is defined inside doTween function, as 6th parameter for xT and yT tweens. Off course, this speed doesn’t have to be constant at all. We will use Numeric Stepper component just to show how to change speed parameter. Instance of Numeric Stepper is "step". We change mentioned parameter from "2" to "step.value".

download hero_v2 source file.

 


When making a game, we will not use Numeric Stepper, but we can change hero speed in this way in relation to health or game level or whatever.

Posted by flanture at 14:51:07 | Permanent Link | Comments (0) |

Wednesday, June 11, 2008

Character elastic movement


Flash game characters doesn’t have to move only in standard way, press left arrow key to move left, right arrow key to move right, space to jump etc. In this new flash game, main character (hero) will move differently. Hero will be dragable and on click, he will perform elastic move. Start position and destination position will be symmetrical in relation to Stage center. Enemy can be destroyed only if mouse is not pressed, otherwise, hero health will decrease.

Now, code. First we import related classes:

import mx.transitions.Tween;
import mx.transitions.easing.*;

We need to define simple onPress, onReleaseOutside and onRelease methods for movie clip of our hero, mcHero. Method onRelease has two functions, findSimPoint() and doTween(). It is obvious that findSimPoint() calculates symmetrical point of hero x and y in relation to Stage center. DoTween(), well, performs the tween! Code comes with comments.


Download hero.fla




Posted by flanture at 15:48:03 | Permanent Link | Comments (0) |

Tuesday, April 22, 2008

Free Flash Games Tutorials


Best recourse I came across lately is the list of 20 free tutorials which can help you start with your Flash games development. Sometimes it’s hard to find even few tutorials and this list is definitely worth reading.

1. Flash Racing Game Tutorial
2. Balloon Shooter
3. Guess Next
4. Space Shooter
5. Platform Game Tutorial Redux: All The Basics
6. Make a dynamic hangman game with XML and ActionScript
7. Snake Game Tutorial
8. Create a survival horror game in Flash tutorial
9. Creating a Flash Lite Game Tutorial (Flash game for Mobile Devices)
10. Flash dodge ball game
11. Create a flash artillery game
12. Creating a Sniper Game in Flash
13. Chicken and Eggs Game
14. Mini Car Race Game
15. Flash ball game with visual effects
16. Flash Fighting Game tutorial
17. Simple Jigsaw Puzzle Tutorial
18. Basic Flash Hit Game Tutorial (Video Tutorial for Beginners)
19. Create a flash game like Security 2
20. Complete Flash pool game with high scores

Big Thanks to Aravind A and DezinerFolio .
If you know for any good tutorial out there or you have one, post it here.

Posted by flanture at 12:30:58 | Permanent Link | Comments (2) |

Friday, November 09, 2007

Snake Game Flash Tutorial


This one is a little bit old, but you can learn from it. Tutorials are written back in 2004, but you can see from comments that during those 3 years people have find tutorials helpful and fun.


Tutorial is written in ActionScript 1.0 for Flash MX. It has around 130+ lines explained in detals. Enjoy.
Digg!
Posted by flanture at 21:19:01 | Permanent Link | Comments (0) |

Tuesday, October 23, 2007

Learning from the source


The best method for learning is learning from the source. When it comes to game development with Adobe Flash, than best place should be Adobe, right?. Watch several videos online and read how to make games with Flash from Jiro Ietaka. Article and videos are hosted at Adobe pages here.

User level for this articles is intermediate.
Posted by flanture at 21:09:14 | Permanent Link | Comments (0) |

Sunday, July 22, 2007

Without Good Title


I have read a little bit more my Flash Mobile book and I made my first application which is actually doing something.

Simple application that shows how screen reacts on keys. This is what I did. Make a movie clip with text field. Name movie clip "mctxt", name text field var "myinput". On root place next code:

fscommand2("FullScreen", true);
_root.mctxt.myinput="keys test";

Make button, put next code for button's actions:

on(keyPress "4")
{
_root.mctxt.myinput="4";
}
on(keyPress "6")
{
_root.mctxt.myinput="6";
}
on(keyPress "5")
{
_root.mctxt.myinput="by flanture";
}


That's it. I tested it and it works great. Don't forget to publish movie with flash lite 1.1 and don't forget (I did) to make text color different from background color. Text field must be dynamic. Also, movie size must correspond with your screen size.

This application is very simple, but it has some usefull elements like reaction on keys and displaying response. These element are basic for any game or serious application. Right.


AddThis Social Bookmark Button

Posted by flanture at 03:08:00 | Permanent Link | Comments (0) |

Saturday, June 23, 2007

Small update


Small update to Sparta Defender, now v0.13. First, I added points won movie clip that let's you know if you killed Persian shield or you missed it. Second, I introduced time limit. Now you have 3 minutes to kill 300 points or 60 Persians or Sparta fill fall.

Download Sparta Defender v0.13
Posted by flanture at 19:39:32 | Permanent Link | Comments (0) |

Thursday, June 14, 2007

Emanuele Feronato rocks !

 

Emanuele Feronato and his website really rocks. For every Flash Game Developer wannabe this is never ending source of useful informations about making games in Flash. More suitable for beginers, but well explained, code everywhere , samples and stuff.

 

I wish I could have more free time to explore it more. Nice work Emanuele !

Posted by flanture at 16:48:54 | Permanent Link | Comments (0) |

Sunday, February 25, 2007

contolling objects in FlashMX


tool : Flash MX

Moving object as movie clips in Flash can be achieved in various ways. One of them is controlling objects with text input box.
First, create new file. You will need two things, movieclip that represents object, and button with input text box. My creations are on picture below.



For button, for every state put keyframe. Set show border around text. Set input text with var : "distance".
Set movieclip instance name as "wheel". Finaly enter action for button:

on(keyPress "< Enter>"){
  _root.onEnterFrame=function(){
    if (_root.wheel._x < distance){
      _root.wheel._x += 5;
      _root.wheel._rotation +=5;
    }
    if (_root.wheel._x > distance){
      _root.wheel._x -= 5;
      _root.wheel._rotation -=5;
    }
  }
}

Another way of moving movieclip is with mouse. In this case we don't have button. MovieClip is same, and only code is in first frame of main timeline.
_root.onEnterFrame=function(){
  if (_root.wheel._x < _xmouse){
    _root.wheel._x += 10;
    _root.wheel._rotation +=10;
  }
  if (_root.wheel._x > _xmouse){
    _root.wheel._x -= 10;
    _root.wheel._rotation -=10;
  }
}
Posted by flanture at 23:13:12 | Permanent Link | Comments (0) |

Sunday, January 28, 2007

array functions tutorial part II



Third function is called searchCount, simply beacuse it counts number of wor in array. It goes something like this:

function searchCount(wor, arr){
   var count = 0;
   for(i=0; i< arr.length; i=i+1){
     if(arr[i ]==wor){
       count += 1;
     }
   }
   return count;
}

Another function is union. If you have two arrays, union will return new array which consist of word that exists in both arrays.

function union(arr1, arr2){   var arr3 = new Array();
  count = 0;
  for(i=0; i< arr1.length; i=i+1){
    for(j=0; j< arr2.length; j=j+1){
      if(arr1[i ]== arr2[ j]){
        arr3[count ] = arr1[ i];
        count+=1;
      }
    }
  }
  return arr3;
}

One more important thing. Data type in these functions dont have to be String, it can be any type. For more strict evaluation, you can put === instead of ==.

- end of part II -
Posted by flanture at 17:29:28 | Permanent Link | Comments (0) |
1 2