A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: more game troubles

  1. #1

    more game troubles

    i did the actionscript for the moving of the ship, and i made the laster that shoots out, and gave it some actionscript so that when the spacebar is held down, it fires, but i have 2 questions. 1. what do i have to change in the script to where all someone has to do i press the space bar and not hold it down, and second, when i fire the laser, once it goes off screen, i press the space bar to fire another one, and no other fires. how do i make it to where the laser fires every time i press the space bar (even multiple lasers on screen if i press it enough)

    thanx in advance

    edit: also, for the first question, i'm using the if (Key.isDown(key.SPACE)) script

    shaggy
    Last edited by xpsyhatchetmanx; 11-01-2002 at 06:10 PM.

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    1,017
    for the space bar, the action is not when the space bar is down, it means when u press it.

    about multiple laser, use duplicate movie clip do copy and then u can put as much lasers u want
    mey the swartz be with you

    http://www.amirlotan.com

  3. #3
    how do i do the multiple instances of the laser? and what do i change in my actionscript to give the space bar just press and not down? right now i have the script as i posted above

  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    1,017
    about the space bar it's ok.

    about the laser, give an instance name to the lase and use

    duplicateMovieClip ("bla", "bla"+i, i);

    where i is a number that increase every time u create one, that means u need to increase him
    mey the swartz be with you

    http://www.amirlotan.com

  5. #5
    ok, i'm a little confused, right now my actionscript for the laser looks like this:

    onClipEvent (enterFrame) {this._alpha = 0;}
    onClipEvent (enterFrame) {if (Key.isDown(key.SPACE)) {this._y += -20;}}
    onClipEvent (enterFrame) {if (Key.isDown(key.LEFT)) {this._x += -4;} if (Key.isDown (key.RIGHT)) {this._x += 4;}}
    onClipEvent (enterFrame) {if (Key.isDown(key.SPACE)) {this._alpha = 100;}}

    the script for the key.left and key.right is to make it to where the laser stays with the ship. i tried putting the script for the duplicate movie clip. and it didn't work. remember, i have about 2% knowledge in actionscript. that's why i'm doing this game, to give myself somewhat of a tutorial. so could you please explain it in a way that an idiot (myself) could understand. thanx

  6. #6
    Senior Member
    Join Date
    Jan 2001
    Posts
    1,017
    the script supose to be copy with the movie.
    all u have to do is give an instance name to your lase and use duplicate to duplicate it
    mey the swartz be with you

    http://www.amirlotan.com

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