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
Scenario stopping on its own without error when testing
By Suhayo, with no replies.
Hi, I"m doing a project on making a racing game. Earlier I wrote a method that's supposed to give an output the instant a key is either pressed down or released, and when I tried running it, the program would run for half a second or so and then just end without any error message in the console. I asked for some help in a discord server and then started some more modifications where I switched from scalar to vector values for everything, and now even with the KeyPressed method not running, I am having the same issue so I can not test any of the changes I just made as it just stops right after i click the run button. Any help is greatly appreciated. here's the class: https://pastebin.com/0nqMGu7k There's also a Vector2D class with basic functions and a MyWorld class that creates the world and player object
Scoring Table
By YagoJose17, with 2 replies.
Last reply by YagoJose17, 6 months ago:
Thank you for your attention, but I have changed the project plans.
any plans to switch to Blockly instead of Stride?
By won0c, with no replies.
Are there any plans to switch to Blockly instead of Stride? I find Stride to be very inefficient. I think it's better to learn the Java language the right way. As an educational platform, I would like to request a switch to Blockly from Stride as soon as possible to make novice students learn programming languages easier.
Removing / Erasing pixels from a Transparent background
By MrBradley, with 1 reply.
Replied to by danpost, 6 months ago:
MrBradley wrote...
It seems that I need to use GreenfootImage#setColorAt(...) with a transparent Color(0,0,0,0) in order to remove / erase pixels, instead of GreenfootImage#drawRect(...) after setting the image color to transparent. This surprised me and seems counter intuitive. Can someone offer an explanation, please? Thanks in advance. << Details Omitted >>
Drawing is like painting. Using clear paint, you cannot remove or hide any color that might already be there. That is, opaque colors remain as is. I would suggest that you use the
clear
How to slow down timer
By Divyanshi, with 2 replies.
Last reply by Divyanshi, 7 months ago:
thank you
How to spawn actor somewhere else.
By raaeeth, with 1 reply.
Replied to by danpost, 7 months ago:
raaeeth wrote...
After my actor hit another actor, it ends the game (thats what I want). Now what I would like to happen is that after I click the reset button, my actor teleports back to the original spawn. I have the button and everything to reset, except the code for the actor to make him go back as well. How can I make an actor teleport with the push of a button?
You should be able to just start a new world (which should be equivalent to a reset). Something like this: <Code Omitted>(where
btnReset
is
Error on Greenfoot Web
By adameins, with 2 replies.
Last reply by adameins, 7 months ago:
Exception instantiating world class: java.lang.RuntimeException - (JavaScript) Error: Invalid recorded state
score counter dosnt work
By JesseJW09, with 4 replies.
Last reply by JesseJW09, 8 months ago:
It didn't work but its ok because I've found a different method for the score counter. Thanks for the help though!
Text gains double spacing when uploaded to website
By Owlias, with 3 replies.
Last reply by danpost, 8 months ago:
Owlias wrote...
one of my sprites (Goblin) doesn't get imported from the files and assigned directly to the actor. I've checked multiple times and it appears to be in there on my version (locally). Any suggestion on getting this image to be assigned? (image is naturally assigned to the actor within Greenfoot app)
You can just set the image in the constructor of the class. For example: <Code Omitted>
Image is only scaling once but never again
By toemilio, with 1 reply.
Replied to by danpost, 8 months ago:
toemilio wrote...
So I'm making a flappy bird project for my computer science class and one of our extensions is to create a powerup that makes you smaller. My problem is that the code will run perfectly once, it scales my image and makes it smaller, but every other time I run it the image stays the same. Every solution I try it will work once but never again. << Code Omitted >>
If line 3 is to be the beginning of the constructor of the class, then the keyword
void
should be omitted from the line.
I have a problem with my code
By Nordrasil, with 5 replies.
Last reply by Nordrasil, 8 months ago:
You're right. It's working now. Thanks so much for everything.
I want to reset the world using this code, butonly after like 7 seven seconds and not immediately
By LOSERrr, with 1 reply.
Replied to by danpost, 8 months ago:
LOSERrr wrote...
<Code Omitted>
Try putting the following line along with the given line: <Code Omitted>
Help with bullets
By sussywussy, with 2 replies.
Last reply by sussywussy, 8 months ago:
Nevermind, it works. Thanks danpost!
Help with contructing a world with objects in a square pattern / line
By Konsti, with 2 replies.
Last reply by Konsti, 8 months ago:
Ooooh my god thank you so much. Hard-coding levels manually would've been extremely tedious and this helps a lot. Gonna try this out now thank you so much
how to make my character jump?
By Nordrasil, with 9 replies.
Last reply by Nordrasil, 8 months ago:
Thank you so much it's working !
2
3
4
5
6
7
8
X