This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Hawx_
wrote ...
2013/5/7
Firing
1
2
Hawx_
2013/5/8
#
Danpost , could you give an example of the code?
Hawx_
2013/5/8
#
Jet , thanks , it's compiling now with no errors :D
JetLennit
2013/5/8
#
No problem! =)
Hawx_
2013/5/8
#
But now they're not firing. Any ideas why?
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_
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
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_
2013/5/8
#
Thanks Davmac.
JetLennit
2013/5/8
#
Duh! I was thinking something else.... sorry about that!
You need to login to post a reply.
1
2
X