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

What is happening right now?

lvl30dragon

reply to How do I draw a circle?

By lvl30dragon - about 8 hours ago
danpost wrote...
lvl30dragon wrote...
I'm trying to draw a circle that increases in size with the middle always being the center of the screen, and then decreases in size by "erasing" the outer circle and then drawing an inner circle. However afaik building a circle using the drawOval method doesn't draw the circle from the center but the bottom left or upper left. how do I do this?
Just subtract half the size of the circle (the radius) from the x and y coordinates of the center. Use the results for the drawOval method call.
That works. Thanks!
danpost

reply to get an actor's start location without hard coding

By danpost - about 22 hours ago
NewUser567 wrote...
If my actor touches a rock, it needs to go back to its starting coordinate and starting rotation. How can i get this without putting in the actual numbers?
You could save the initial location coordinates and rotation in fields when the actor is added into the world. Then (re)set location and rotation to those values when needed (hits rock).
danpost

reply to getting actor height from world class

By danpost - 1 day ago
NewUser567 wrote...
I want to use a for loop to insert a horizontal line of rocks as a border. How can i do this from the world class? I would need to get the actor’s width and height from the world class right? They have to all be at the same height, and right next to each other
Yes. You can get the dimensions of a rock before the loop: <Code Omitted>This should put them along the bottom of the screen as a border.
danpost

reply to Gaining Health

By danpost - 1 day ago
Maybe: <Code Omitted>