Play the games, create the levels

Topic, Curtain fire shooting game

Checkout our iPhone & iPad games!

You must register or log in to post a message.

ThePeejsterM 14 years ago
  That isn't what I was looking for. What I meant was how to make the player be able to assign those values.
Asforien 14 years ago
  AS3 is very different from AS2... I don't exactly get what you are trying to do from your description...

If you wanna change the width of a line usually you make use of the height/width property of the symbol

For the speed of a bullet, you declare a velocity variable (V) eg. var V = 5;

Then you add an ENTERFRAME event listener, every frame you move the bullet by 5 units.

For angle, declare a variable in radians (? i think all angles except for .rotation is in radians) eg. var angle = pi/4; *you can either use Math.PI or just use 3.14*

Then you resolve the velocity into the x and y direction:

Vx = V Math.cos(angle);
Vy = V Math.sin(angle);

**Do you need to import flash.Math.*?? i forgot...


So in the event instead of moving by 5 in one direction you move it separately in two directions:

x += Vx;
y += Vy;


You may have to experiment with the cos and sin functions and the + and - signs because in flash the y direction is downwards.
ThePeejsterM 14 years ago
  OK guys, I don't know how to allow the player to assign attributes to a symbol (like changing the width of a line in JG2). The attributes I plan on making are the angle and speed a bullet will move by, and the times when a bullet will appear, and when it will remove itself from the game. Anyone feel like helping me with this? I've already got the basic idea of the code I will make that combines and uses these attributes.
ThePeejsterM 15 years ago
  You're off by one number, bud. AS3 isn't much different from AS2 aside from additional functions, so I'll contact you if I run into anything.
Hexicube 15 years ago
  no but I can script fairly well in Flash 8(assuming that's what your using)
ThePeejsterM 15 years ago
  Anybody here have any confidence in their abilities to make music?
ThePeejsterM 15 years ago
  Gah, so that's it. And I was so used to Flash MX, too.
Asforien 15 years ago
  ? how are you trying to add actionscript? In AS3 you can't add directly to an object now, you need to create a class out of the symbol, and create a new .as file which contains the script.
ThePeejsterM 15 years ago
  It's not letting me assign actionscript to the player. This is truly an evil programming language.
ThePeejsterM 15 years ago
  You really ought to update then.
SuperDog 15 years ago
  I have Flash 8, can make a game too.
ThePeejsterM 15 years ago
  I don't quite understand what you mean by "grandchildren". You mean one movieclip that's contained inside of another?
Asforien 15 years ago
  You could simply keep track of the number yourself, each time you add one movieclip you add one to the counter at the same time, and same for removing.

But if I'm not wrong there's a numChildren property that you could use? (though it won't work if you have grandchildren objects)
ThePeejsterM 15 years ago
  Gah... I need a piece of code that can count the amount of movieclips on the screen. Is there any such function?
Im 15 years ago
  It would be useful if people want to help you. :)
ThePeejsterM 15 years ago
  Any reason in particular you wanted to know what I'm using?
Im 15 years ago
  OK.
ThePeejsterM 15 years ago
  It's Flash CS3. I'm also using AS3.
Im 15 years ago
  Sounds cool. What do you use, CS4?
AS2 or 3?
ThePeejsterM 15 years ago
  I decided to make my first game.
So, I'm keeping this list to note my progress, and you can also make suggestions.
EDIT: As of 8/14, I lost ABSOLUTELY EVERYTHING.
Player Images = X
Player Actionscripting = X
Object Images = X
Object Actionscripting = X
GUI = X
Game Actionscripting = X
Editor Actionscripting = X
Music = X

[<<] [1] [2] [3]

Flash game development

First post of the topic

ThePeejsterM 15 years ago
  I decided to make my first game.
So, I'm keeping this list to note my progress, and you can also make suggestions.
EDIT: As of 8/14, I lost ABSOLUTELY EVERYTHING.
Player Images = X
Player Actionscripting = X
Object Images = X
Object Actionscripting = X
GUI = X
Game Actionscripting = X
Editor Actionscripting = X
Music = X
Our free flash games   Games for your site   Games for your iPhone   Contact   Twitter @jpsarda & @bonuslevelorg