Forums

Remove Ad
Reply  Post New Thread
 
Thread Tools
Old 2nd July 2009   #1 (permalink)
Forum Junior
 
 
Level: 8
Level up: 77%
Activity: 0%
Posts: 347
Status: Offline
Thumbsup Icon Flash Tutorial: Hero Ship

Make sure you have the program MACROMEDIA FLASH version 7 or higher

1.) Open Flash

2.) Select NEW FLASH DOCUMENT

3.) Create or Upload your Hero Ship image and convert to movie clip.

4.) Click the drop arrow and select EXPORT FOR ACTIONSCRIPT and EXPORT IN FIRST FRAME
-Then put it where you want on the stage

5.) (after object is created) Go to FILE>NEW>ACTIONSCRIPT FILE

6.) paste the code below into that spot.

class Ship extends MovieClip
{
var velocity;
var shootLimiter;
var enemyTimer;
var enemies;
var score;
var health;

function onLoad()
{
velocity = 10;
shootLimiter = 0;
enemyTimer = 0;
enemies = [];
}

function onEnterFrame()
{
shootLimiter += 1;

if( Key.isDown(Key.RIGHT) ){_x += velocity; }
if( Key.isDown(Key.LEFT) ){_x -= velocity; }
if( Key.isDown(Key.UP) ){_y -= velocity; }
if( Key.isDown(Key.DOWN) ){_y += velocity; }

if( Key.isDown(Key.SPACE) && shootLimiter > 8)
{
shootLimiter += 0;
var missile = _root.attachMovie( "Missile" , "Missile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
missile._x = _x + 50;
missile._y = _y + 2;
}

enemyTimer += 1;

if(enemyTimer > 60)
{
enemyTimer = 0;
var enemy = _root.attachMovie("EnemyShip", "EnemyShip" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(enemy);
}

function updateScore(points)
{
score += points;
_root.scoreText.text = score;
}

_root.ship.updateScore(50);

function resetScore()
{
score = 0;
_root.scoreText.text = score;
}

function updateHealth(points)
{
health += points;
_root.healthMeter.bar._xscale = health;
}
function resetHealth()
{
health = 100;
_root.healthMeter.bar._xscale = 100;
}
}
}



7.) Save the document as class.as in the same folder your SWF is in
(example: Class- Ship I wold save it as Ship.as)

8.) Save the SWF in the same folder as the actionscript

TEST MOIVE to check if works

if anyone needs a tutorial/question, please notify me and I will try to help/asses the problem/help/tutorial/

If you see any other flash tutorials like this one and were made by me: They all go to the same game
Reply With Quote
Old 20th July 2009   #2 (permalink)
;D
 
 
Level: 8
Level up: 78%
Activity: 0%
Posts: 483
Status: Offline
Default Re: Flash Tutorial: Hero Ship

Wtf?
Reply With Quote
Old 20th July 2009   #3 (permalink)
Me♥Julia♥Lynn♥Leslie♥T ai♥
 
 
Level: 16
Level up: 26%
Activity: 0%
Posts: 1,367
Status: Offline
Default Re: Flash Tutorial: Hero Ship

Why did you bump this?
__________________
Quote:
4eva_n_eva wrote: View Post

Really? All I'm trying to say is.....
I'm horny.
Quote:
shay_iz_back wrote: View Post

so im guessin you knoo each other so i guess im going to join
-jumpsz in both of you guysz arms-!!!
Quote:
4eva_n_eva wrote: View Post

OLD PEOPLE ARE F***ING HOT
Reply With Quote
The Following Meezers Support sweetheart-gurl's Post:
punky9on5 (20th July 2009)
Old 22nd August 2009   #4 (permalink)
Forum Junior
 
 
Level: 8
Level up: 77%
Activity: 0%
Posts: 347
Status: Offline
Default Re: Flash Tutorial: Hero Ship

Bump
__________________
http://forums.meez.com/forums/geek-central/951286-problems-requests-flashedchris.html
Reply With Quote
Old 23rd September 2009   #5 (permalink)
Forum Junior
 
 
Level: 8
Level up: 77%
Activity: 0%
Posts: 347
Status: Offline
Default Re: Flash Tutorial: Hero Ship

*bump
__________________
http://forums.meez.com/forums/geek-central/951286-problems-requests-flashedchris.html
Reply With Quote

Reply  Post New Thread

Thread Tools

Forum Jump


All times are GMT -8. The time now is 10:31 PM.
To change your timezone, use 'Edit Options' under the 'Settings' menu.




Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0