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
Discussions
You need to login to take part
Current Discussions
Create Timer
By RedMine360, with 2 replies.
Last reply by RedMine360, over 7 years ago:
Nice thx and the information about the 60 act cycles is also very usefull.
Actor not in world
By Kofi11, with 2 replies.
Last reply by danpost, over 7 years ago:
RedMine360 wrote...
If removeEnemy() is also removing the Enemy than thats the problem. After it got removed by removeEnemy(), hitByProjectile() is starting but it is not there anymore. Possible soultion check if Enemy is on the field and only than it is possible to get hit. << Code Omitted >>
Sorry, but that is not a possible solution. In fact, it has the same failings as the initial issue -- a
NullPointerException
error will be thrown on line 5, here. You cannot call a method (
getObjects
,
removeObject
or any other
World
method) on the returned value of
Emergency Guys!! How can randomly moving object not move through wall??
By yalamberingnam, with 30 replies.
Last reply by yalamberingnam, over 7 years ago:
Yes, I have used this code in my project. Thank you for your time I appreciate.
Adding in objects randomly
By coreypants03, with 8 replies.
Last reply by danpost, over 7 years ago:
The field name should probably actually be
curTime
, meaning the current time. It, as well as
lastAdded
, whose value is the actual time that an enemy was last added into the world, should both be declared somewhere. Since the
lastAdded
field needs to be retained through multiple act steps, it must be declared outside the method:
Adjust infinite scroll background speed!
By stantwice, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Show your code.
Scoreboard - Broken!
By CreatorMoon, with 6 replies.
Last reply by CreatorMoon, over 7 years ago:
Sorry, the "exact same appearance" thing was weird. It works now, thanks!
Problems with LineOfSight Method
By LobsterL, with 6 replies.
Last reply by Super_Hippo, over 7 years ago:
You create two objects of Army1 and Army2. Each. And you pass the ones to the LineOfSight object which aren't added to the world. Remove the prepare method and add army1 and army2 to the world that you create in line 5 and 6.
Act delay for method not working
By ShatteredAsh, with 3 replies.
Last reply by danpost, over 7 years ago:
ShatteredAsh wrote...
Line 25 is because I want to announce a win or loss to my players. My only other idea would be to place a 600x400 image centered in my world announcing it, but placing images gives me problems lol
Not sure why you mention this. I was not saying to remove line 25 or anything like that.
setting koordinates problem
By plsFast, with 3 replies.
Last reply by danpost, over 7 years ago:
This does the same: <Code Omitted>
Making buttons change worlds depending on the image
By Erasedsword, with 3 replies.
Last reply by danpost, over 7 years ago:
I think the problem is that the level counter is always initially one every time you create a new
Levels
object. I do not think it to be a very simple fix. Maybe you should take a look at my
Super Level Support Class Demo
scenario. It might lead you in the right direction.
Method head
By plsFast, with 3 replies.
Last reply by danpost, over 7 years ago:
plsFast wrote...
but i want the input to be limited because i only need numbers from 1-7 and the method doesnt work because u could pick 8 or so
<Code Omitted>
need help fast
By plsFast, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
They open this discussion instead of the real one which isn't helping you at all.
Making a scoreboard
By mumzel, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
I don't know what question 9.69 is or how exactly the code looks (I am looking at asteroids-3 right now, so the counter is already there, just not functional). You have the space, the rocket, bullets and asteroids. The world instance should create and add a counter to the world (to itself). It should also keep a reference to this counter. Then, when you want to add points to the counter (e.g. a bullet hits an asteroid), you get the reference to the counter from the world and add one point to the counter.
Can anybody help me?
By plsFast, with 4 replies.
Last reply by Super_Hippo, over 7 years ago:
It does it in the same act-cycle. So it won't be visible there if it immediately moves back. Otherwise, you had to replicate the isTouching method instead of using the current location, use the one which it would have after moving. But that is really unnecessary. To the first question. You could exit your method with an error message if x or y are greater than 7.
Large hit box
By Erasedsword, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
I have no clue what "pikel" is. However, make sure that there are no needless transparent areas around your images. As an alternative, you can use methods which do not take the image into account, but only the position of the object.
201
202
203
204
205
206
207
X