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

2013/5/7

Firing

1
2
Hawx_ Hawx_

2013/5/8

#
Danpost , could you give an example of the code?
Hawx_ Hawx_

2013/5/8

#
Jet , thanks , it's compiling now with no errors :D
JetLennit JetLennit

2013/5/8

#
No problem! =)
Hawx_ Hawx_

2013/5/8

#
But now they're not firing. Any ideas why?
JetLennit JetLennit

2013/5/8

#
How long are you waiting? You may need to change if(Greenfoot.getRandomNumber(300) + 400 < this) to a higher number (for it to be quicker)
Hawx_ Hawx_

2013/5/8

#
doesn't seem to be working , I've just updated the game so that you can have a look at the code.
davmac davmac

2013/5/8

#
This code:
    if(Greenfoot.getRandomNumber(300) + 400 < 10)     
... is not right. If you get a random number from 0-299, and add 400, the result will never be less than 10. If you took out the '+ 400' it would probably work ok.
Hawx_ Hawx_

2013/5/8

#
Thanks Davmac.
JetLennit JetLennit

2013/5/8

#
Duh! I was thinking something else.... sorry about that!
You need to login to post a reply.
1
2