Jump to content


Game problems with Depth, moving, edges...


  • You cannot reply to this topic
2 replies to this topic

#1 Sergej

    Young Padawan

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Slovenia

Posted 15 June 2007 - 09:10 AM

Hi,

I have lot of problems with my FLASH game...
On this link you can see how it works for now..
http://www.zamislim....log/?page_id=48

I have problems.. becouse I would like to make bottom with HIT test, that my caracter could die.. and I don't know how to make this...

CODE, problem is.. that I have gravity, and my caracter keep faling down trough the stage (I would like to limit his flying space)...

this.onEnterFrame = function() {

if (Key.isDown(Key.LEFT) && (_root.dragon_mc._x >= 0)) {

_root.dragon_mc._x -= dragonSpeed;

} if (Key.isDown(Key.RIGHT) && (_root.dragon_mc._x <= stageHeight)) {

_root.dragon_mc._x += dragonSpeed;

} if (Key.isDown(Key.UP) && (_root.dragon_mc._y >= 0)) {

_root.dragon_mc.stime = 0;

_root.dragon_mc._y -= dragonSpeed + 10;

} if (Key.isDown(Key.DOWN)&& (_root.dragon_mc._y <= stageWidth)) { // 

_root.dragon_mc._y += dragonSpeed;

} if (Key.isDown(Key.SPACE)) {

bulletCounter++;

if ((bulletCounter % bulletDensity) == 0) {

fireBullet();

}

}

}



this.dragon_mc.onEnterFrame = function() {

this._y -= gravity;

}

Other problem,
How can I remove everything from the stage at the same time...
I need code *I really don't know how to do this..

function removeEverything() {
blabalbalbal
}


this is for now...

Edited by Sergej, 15 June 2007 - 09:14 AM.


#2 Pax

    P2L Jedi

  • Members
  • PipPipPip
  • 911 posts
  • Gender:Male
  • Location:Windsor, ON, Canada

Posted 15 June 2007 - 09:40 AM

Have some minimum and maximum values for the x/y coords of the mc. If the mc x/y is less than the min, set the x or y to the min value, if its greater than the max, set it to max.

#3 Will0wz

    Jedi In Training

  • Members
  • PipPip
  • 348 posts
  • Gender:Male
  • Location:Shed

Posted 15 June 2007 - 09:51 AM

an error i spoted is that when u check the help page it's under some of the layers. make sure it's at the top so tht its readable.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users