This site requires JavaScript, please enable it in your browser!
Greenfoot back
Prish950
Prish950 wrote ...

2013/2/20

NEED MORE HELP CONECT FOUR KEY ADD OBJECT

Prish950 Prish950

2013/2/20

#
I want that every time that i press the keys 1,2,3,4,5,6,7 that than are spawning red stones the problem is after the 5. it wont work any more it take a lot of time to spawn and sometimes i have to press the keys twice can anyone help me ?? In need another method but i dont know!!! (I tryed ifkeyisdown this wont work for me too)
public void act() 
  {
      String key = Greenfoot.getKey();
      
    if ("1".equals(key))
      {
          getWorld().addObject(new RoterStein(), 1,0); 
          
      }
    
    if ("2".equals(key))
      {
          getWorld().addObject(new RoterStein(), 2,0); 
          
      }
      
    if ("3".equals(key))
      {
          getWorld().addObject(new RoterStein(), 3,0); 
          
      }
   
    if ("4".equals(key))
      {
          getWorld().addObject(new RoterStein(), 4,0); 
          
      }
      
    if ("5".equals(key))
      {
          getWorld().addObject(new RoterStein(), 5,0); 
          
      }
      
    if ("6".equals(key))
      {
          getWorld().addObject(new RoterStein(), 6,0); 
          
      }
      
    if ("7".equals(key))
      {
          getWorld().addObject(new RoterStein(), 7,0); 
          
      }
PS: I GOT A SECOND PLAYER WHO IS SPAWNING WITH Q,W,E,R,T,Z,U SO PLS HELP ME!!!! THX
danpost danpost

2013/2/20

#
NVM
You need to login to post a reply.