Results 1 to 3 of 3

Thread: 2 player jeopardy (as 2.0)

  1. #1

    2 player jeopardy (as 2.0)

    Hello, I'm doing a 2 player jeopardy game for a school project and I'm having some problems.

    This is how it works: When the players see the question they have to press a button on the keyboard and the player who press first gets to answear.
    Lets say player 1 have to press left arrow key and player 2 right arrow key, how do I do so when for example player 1 press the key first player 2's key take no action?

    and also when the player who press first gets to answear he has to hold down his key and at the same time press the answear he think is right. So I need something that knows who pressed first to tell what key that need to be pressed to allow an answear.

    Heres the code I have atm:

    for the key press:
    PHP Code:
    onClipEvent (enterFrame) {

        if (
    Key.isDown(Key.RIGHT)){
            
    _root.wp.text += "player 2 gets to answear";
            
        }

    PHP Code:
    onClipEvent (enterFrame) {

            
        if (
    Key.isDown(Key.LEFT)){
            
    _root.wp.text += "player 1 gets to answear";
        }

    for the answear button (here I need something that does that only the player who pressed first gets to answear):
    PHP Code:

            on 
    (release) {
        if (
    Key.isDown(Key.LEFT))
    {
            
                
    this.gotoAndStop(2);
            
            }} 
    Thanks and sorry for bad english
    // Simon

  2. #2
    in the way you are doing it the statements are being executed one after the other, thereby giving a upperhand to the first key check. so in this situation i would suggest using a key listener. key listeners are described beautifully on this very site...just look for it, and you will get the job done in no time.


    Also , this might help http://www.video-animation.com/flash8_024.shtml
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  3. #3
    hehe I thought one of my fingers where a bit faster then the other when trying it out because most of the time player 1 won

    thanks
    //Simon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012