dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Looading guns and a wall

  1. #1
    Junior Member
    Join Date
    Feb 2004
    Posts
    4

    Looading guns and a wall

    hi.

    i am making a game and i have 3 questions.

    How do i make a wall that will keep my character from moving that way?

    How do i set the key.isDown(key.TAB) but replacing TAb with a letter
    like "a". It says that a is not a property

    How do i limit projectiles? i can shoot, but i want it to take a few seconds to load, and not shoot immediately.

    Thanks a bunch.

  2. #2
    Member
    Join Date
    Oct 2003
    Location
    Finland
    Posts
    84
    1. The elusive hitTest explained

    2.Use key codes ( a = 65, b = 66 c = 67 etc.)
    code:
    _root.onEnterFrame = function(){
    if(Key.isDown(65)){
    trace("a is down")
    }
    }



    3.You would have to use some kind of timer. For example:

    code:

    shootTime=5
    i=shootTime
    _root.onEnterFrame=function(){
    if(Key.isDown(SHOOTKEY)){
    i++
    if(i>=shootTime){
    //shoot code
    i=0
    }
    }
    }



    Where shootTime is how long between the shots there will be and SHOOTKEY is the key you want to use for shooting

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