A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: [MX04] [Help]Spaceship Game Coding

Threaded View

  1. #9
    Needs help with flash.
    Join Date
    Aug 2007
    Location
    earth
    Posts
    15
    sorry if this is bumping the thread but i havent went on very much but anyways, my new errors...

    1.
    okay.. i put lifeboss1 -= 3 into the weapon's MC
    i also put: set(lifeboss1, 200); into the beggining of the boss's first frame of the MC
    and i put: if (lifeboss1 == 0) {gotoAndStop (1222)} frames where the boss is in the screen.
    so far it doesnt work
    NOTE: -frame 1222 is the shop.
    -lifeboss1 is the variable for BOSS1's health

    2.
    for the life i put:
    Code:
    set(life, 10);
    if (life == 0) {
    	gotoAndStop("2", 1);
    }
    into the the player's LIFE frames.

    and i put:
    Code:
    _root.dead = Number(_root.dead)+1;
    _root.score = 0;
    _root.HEALTH.Play();
    life -= 1
    into the player's MC

    same as the last, didnt work...
    NOTE:
    -life is the variable for the player's health
    -HEALTH is the MC that keeps track of your lives/life nad will go down everytime your hit and up everytime you get lives

    3.
    could you add code to that?(the exact)
    NOTE:
    -"The-Gun" is called, beam
    -and i use _root.score to calculate the score

    4.
    Code:
    if (beam1 == 1) {onClipEvent (load) {
    	beamMoveSpeed = 25;
    	this._x = _root.player._x+30;
    	this._y = _root.player._y;
    }
    onClipEvent (enterFrame) {
    	this._x += beamMoveSpeed;
    	if (this._x>600) {
    		this.removeMovieClip();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.ENEMY1)) {
    		_root.ENEMY1.Play();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.ENEMY2)) {
    		_root.ENEMY2.Play();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.ENEMY3)) {
    		_root.ENEMY3.Play();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.ENEMY4)) {
    		_root.ENEMY4.Play();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.ENEMY5)) {
    		_root.ENEMY5.Play();
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.BOSS1)) {
    		_root.BOSS1.Play(); Play(); Play();
    		lifeboss1 -= 3
    	}
    }
    onClipEvent (enterFrame) {
    	if (this.hitTest(_root.BOSS1)) {
    		_root.BOSSHEALTH1.Play(); Play(); Play();
    	}
    }
    }
    ERROR: Statement must appear within on/onClipEvent handler
    i put: if (beam1 == 1) {...}
    there because, the variable: beam1 is set to 0, so when you actually buy the weapon, beam1 will add 1. causing the statement true.

    but because of the error, it wont work...
    NOTE: -beam1 refers to the weapon's MC's variable (hope i said that right )
    P.S. i added the NOTES to help understand the questions.
    Last edited by ~ZOMG~; 08-16-2007 at 06:19 PM. Reason: added an extra space

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center