The Armor Games website will be down for maintenance on Monday 10/7/2024
starting at 10:00 AM Pacific time. We apologize for the inconvenience.

ForumsProgramming ForumFiring a bullet

18 9613
markzi
offline
markzi
103 posts
Nomad

I made the gun that rotates and the bullet as well, but I do not know the functions necessary to fire the bullet. Please help.

  • 18 Replies
gaboloth
offline
gaboloth
1,612 posts
Peasant

Well I'm not very used to frames. I would try to attach the gun as a child of the player, but I have no idea if it's possible using as2 and frames.
So, another fair solution could be to move the gun to the player's position in an onEnterFrame function.

markzi
offline
markzi
103 posts
Nomad

I tried the second one, it didnt work, What's a child of the player? How do I do that?

gaboloth
offline
gaboloth
1,612 posts
Peasant

in as3 the function for attaching a movie clip is addChild(). if you call it in some object's class, the new movieclip will be a child of that object, so it's inside it and it will move together with his parent. but I dont know how to use it in as2. i would try to use the attachMovie() in the object's class, but with frames i' pretty clueless.

Showing 16-18 of 18