Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function addenemy():void
- {
- var mob:MC_enemy1 = new MC_enemy1();
- enemy.push(mob);
- stage.addChild(mob);
- mob.x = 800 + mob.width;
- mob.y = mob.height + Math.random() * 601 - mob.height;
- }
- public function shoot():void
- {
- var bullet:Sprite = drawcircle(0x0000ff,2);
- stage.addChild(bullet);
- bullet.x = hero.x;
- bullet.y = hero.y;
- bullets.push(bullet);
- }
- public function bulletmovement():void
- {
- for(var j:int = 0 ; j < bullets.length ; j++)
- {
- bullets[j].x += bulletspeed;
- if(bullets[j].x >= 800 && stage.contains(bullets[j]) == true)
- {
- stage.removeChild(bullets[j]);
- bullets.splice(j,1);
- break
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement