A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: I'm Stumped

  1. #1
    Here's the prob, i have a game in which the user can change weapons by pressing a different number. in level one i want to have a door which could only be opened with a key but i can't seem to do it!!! please help

  2. #2
    Information Architect Subway's Avatar
    Join Date
    Feb 2000
    Location
    Switzerland
    Posts
    4,779
    I use a variable to do this (open a door with a key)

    Example (not real code):

    door12key = false;

    onGameEvent(take door12key){
    door12key = true;
    }

    if (door12key){
    opendoor(door12);
    }

  3. #3
    thank you
    but what's onGameEvent i've haven't used that one yet

  4. #4
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Well what you can do is to crate an array which holds all items which you can encounter during the game and which you can pick up. You will need a collision detection as well. example:

    You walk arround the maze and you see a key on the floor. You go over it ( collision detection here ) the key disapears (_visible=0) and you change your array in a way that it holds the variable key. You approach the door ( collision detection ) and look in the array to see if the variable key=true there. if its there open the door if not show a msg. like " you need a gold key to open the door".
    Same whith the guns which you find in the mase. Just and array variable.
    Mad_sci

  5. #5
    This will probably sound stupid but i don't understand arrays could u explain them to me or is there a tut that does??

  6. #6
    well???
    what's an array???

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