PDA

View Full Version : [AS2] space shooter game


lurvsoft
12-05-2010, 07:08 PM
ok so im making this shooter game where 2 players shoot bullets at each other, i want so when the bullet hits the other player it disappears,

if i could just put a hitTest script into the MC's which remove the bullet when the bullet and the player comes in touch.

player 1 instance name: p1
player 2 instance name: p2

bullet which player 1 shoots: bullet1
bullet which player 2 shoots: bullet2

thanks

neilmmm
12-05-2010, 08:03 PM
welcome

what is your code that moves the bullet?

lurvsoft
12-05-2010, 08:09 PM
sorry i started from scraTCH, i followed some shitty tutorial which didnt explain alot, now i just need a code that duplicates a movie clip, i cant get this working, i've been on this for months but i can never get it working

lurvsoft
12-05-2010, 08:12 PM
HOw do i make a bullet that shoots from a movie clip when i press SPACE?
i dont get the duplicate movieclip and removemovieclip things, can u help me or post some kind of tutorial pls

i have searched google for hours now and i cant find an answer

neilmmm
12-05-2010, 09:39 PM
most tutorials would go along these lines

var bulletSpeed:Number=5
function mover () {
this._x+=bulletSpeed
if (this.hitTest(player_mc)) {
this.removeMovieClip()
}

}

onMouseDown=function () {
var bullet:MovieClip=this.attachMovie("bullet","bullet",this.getNextHighestDepth())
bullet._x=gun_mc._x
bullet._y=gun_mc._y
bullet.onEnterFrame=mover
}

neilmmm
12-05-2010, 09:43 PM
see my reply to your other thread

and check out this site (http://www.freeactionscript.com/2009/06/flash-game-projectile-weapons/)

lurvsoft
12-06-2010, 01:45 PM
unexpected file format :/