Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 10-06-2008, 11:24 PM   #1
Registered User
Join Date: Mar 2008
Posts: 5
Default help with asteroids type game?

I am still kind of new to flash. I've used it for a year but in high school. I am trying to figure out script, go the direction the space ship if going. I have the keys working and the ship rotating but I have no idea how I would make it just go forward at any direction. I would be very gracious of any help. thanks
brandong08070 is offline   Reply With Quote
Old 10-06-2008, 11:59 PM   #2
Headshotz's Avatar
Join Date: Jul 2005
Location: Batcave
Posts: 2,761
Send a message via MSN to Headshotz

Hi, this is for static movement speed, obviously you can make some changes so he speeds up and stuff but this should allow you to get an idea of the maths behind simple angular based movement.

ActionScript Code:
//Headshotz //init vars var cons:Number = 2  //Constant speed variable //init main onEnterFrame = function() {     if (condition) //Your condition to let the mc move     {                             my_mc._x += Math.sin(my_mc._rotation * (Math.PI / 180)) * cons;        my_mc._y += Math.cos(my_mc._rotation * (Math.PI / 180)) * cons * -1;             } }
The author of windows file copy dialogue visits some friends:
"I'm just outside of town so I should be there in about 15 minutes"
"Actually it's looking more like 6 days"
"No, wait, 30 seconds"
Headshotz is offline   Reply With Quote
Old 10-07-2008, 12:00 AM   #3
Registered User
Join Date: Apr 2008
Posts: 363


After reading that page go to contents and download the source file. Its lesson 4 for movement. It wouldn't hurt if you went through the whole tutorial, some good stuff there.
pierre23 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a guitar hero type game???!! jasonm911 Gaming and Game Development 4 11-10-2007 10:40 PM
Nietzsche: My first AS2 game SHDR Gaming and Game Development 2 07-16-2007 08:13 AM
Rate My Game, plz fill the questioner UzumakiJr Site Check 0 12-16-2006 08:48 PM
ActionScript Programmer needed for online boxing card game MarkyX Projects and Positions 0 07-10-2006 03:05 AM
how would i go about creating a warioware type game? [email protected] Gaming and Game Development 1 03-27-2005 11:51 AM

All times are GMT. The time now is 07:08 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.