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
Moving an actor towards another without rotating
By VOiDBABY, with 1 reply.
Replied to by danpost, 5 months ago:
VOiDBABY wrote...
I'm creating a 2D game in which enemies on the right side chase after the player on the left side. I was wondering if there's another way for the enemies to chase after the player as they move without rotating as it flips the images (has animations) upside down and backwards. I'd appreciate any suggestions or feedback! Here's my current code: << Code Omitted >>
Just reset the rotation back to zero after moving: <Code Omitted>
Bullet despawn
By Wizzzarium, with 2 replies.
Last reply by Deepfist, 5 months ago:
You need to implement a hit registration, you can do this the following way <Code Omitted> <Code Omitted>In this instance the bullet is looking if it intersecting with the actor Object. If it isn't intersecting (so it is null or == null), then it returns false
How to make a bullet disappear after hitting?
By Wizzzarium, with 3 replies.
Last reply by Wizzzarium, 5 months ago:
<3
How to code Player chasing an actor but it runs away as much as possible from the player?
By MuchieBun, with 1 reply.
Replied to by danpost, 5 months ago:
MuchieBun wrote...
It's like ghost from Pacman. I don't know how to code it, I've found sources but I can't understand it how it works. It's really difficult.
To run away: <Code Omitted>That is one way, at least. The idea of other ways is the same. Determine where (and possibly, how close) the player is, then turn away and move it.
Can you help me to solve this error?
By MuchieBun, with 6 replies.
Last reply by danpost, 5 months ago:
MuchieBun wrote...
how can i make my manager not to go through walls. Because, when the manager start to chase the player, it goes through the walls. :((
Well, you probably just want to reverse the moving if a wall is encountered. That is: <Code Omitted>There is no need for a separate method for this (remove the "
public void Wall()
' method). The order of instructions in your
act
method should probably be as follows:
I need Help Programming smooth Mouse Moving for a Parking Jam type game
By JyspeKV2, with 4 replies.
Last reply by JyspeKV2, 5 months ago:
The first Fix works Perfectly thank you danpost
Transfer values from world class to an actor class and vice versa
By Ramrun, with 3 replies.
Last reply by danpost, 5 months ago:
Ramrun wrote...
In one of my cases, the value of three int variables is determined in the subworld class 'Bloodstream' in the following code: << Code Omitted >> It should then be possible to use these three variables in the actor subclass 'whitecell' That is my try: <Code Omitted>
Assuming the variables in question are declared
static
, all you need do is put the class name first (before the variable names) on the right side of the 3 lines. If they are not
I need help publishing my game
By SaltyBacon, with 4 replies.
Last reply by danpost, 5 months ago:
SaltyBacon wrote...
It didn't fix it. do you have any other ideas?
There is one in your
Counter
class and one in your
HealthCounter
class as well. If it does not work after changing those also, you may have to consider loading the music files on the fly, instead of right at the beginning. For example: <Code Omitted>You would then have to check if the val
How to make actor switch between two images
By BigDogAlex, with 4 replies.
Last reply by BigDogAlex, 5 months ago:
Thank you for the help.
hello i am new here working on a project
By jaymesww, with 2 replies.
Last reply by jaymesww, 5 months ago:
thank you danpost
how to make objects spawn in a certain place
By big, with 1 reply.
Replied to by danpost, 5 months ago:
big wrote...
how to make objects spawn in a certain place
The
addObject
method has two
int
parameters for the x- and y-coordinate values at which to place an object. If you want specific help, show your current codes and explain, in detail, what it is you wish to accomplish. Then, explain how it is not doing what you want and what you think needs to be changed.
Running Greenfoot on M1
By xilefP, with no replies.
Hi, has anybody experience with installing Greenfoot on M1 Macs? I didn't find anything about it on “the internet”.
I know that it is currently not officially supported.
Cheers xilefP
Limit the Spawner
By Mzarifin58, with 4 replies.
Last reply by danpost, 5 months ago:
Mzarifin58 wrote...
I have try your program, but why does the enemy spawn all at once? And them spawn continuosly
They should not. Please show your code (entire class please).
Creating a Game
By Lolboy123, with 1 reply.
Replied to by danpost, 5 months ago:
Lolboy123 wrote...
I want to have a bullet delay for the Shooter but I'm not sure how to code it << Codes Omitted >>
Just add an
int
shot delay timer to the
Shooter
class: <Code Omitted>
Stop Either Method
By Mzarifin58, with 4 replies.
Last reply by danpost, 5 months ago:
Mzarifin58 wrote...
I have try your program in my program, buat it doesnt work
Please show attempted code (entire class please).
1
2
3
4
5
6
7
X