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
Making objects fall in a certain area
By vysh, with 4 replies.
Last reply by vysh, almost 7 years ago:
Thank you lord danpost :D ! I'll try this out!
Ayuda para que el objeto coma
By Jesus1357, with 1 reply.
Replied to by danpost, almost 7 years ago:
Usa: <Code Omitted>
Bringing functions from another class
By anonymous_panda, with 1 reply.
Replied to by danpost, almost 7 years ago:
Using just: <Code Omitted>in your
Fish
class indicates that the method is either (1) in the
Fish
class; (2) in any one of its super classes (as a non-private method); or (3) in an interface that one of the aforementioned classes implements. Since it (the method) is located in your
Level2
class, you need to indicate that that is where to find the method. Actually, it is the
Level2
object (your current world object) that "has" the method. It is the
score
in that world that you want to increment. The
getWorld()
method will return a r
Comer
By Jesus1357, with no replies.
Hola, alguien me podria ayudar con el programa para poder hacer comer a un objetos
Background image location
By JamesR, with 1 reply.
Replied to by danpost, almost 7 years ago:
JamesR wrote...
How do I make the background image move to the bottom left corner?
Very vague and without details.
Actor has to place a Track.
By ITStudent, with 5 replies.
Last reply by ITStudent, almost 7 years ago:
Thanks a lot! :) Its not like i had imagined, because of the gaps and so on, but its fine. If you have an idea how i can edit that with the big gaps i would like to hear. But afterall my school-mission is completed. Thank You. Thats my script: myworld: private void prepare() { Ball ball = new Ball(); addObject(ball,277,257); ball.setLocation(300,300); RobotMaBoi robotMaBoi = new RobotMaBoi(); addObject(robotMaBoi,80,600); robotMaBoi.setLocation(80,565); } RobotMaBoi: public class RobotMaBoi extends Actor
Help with keeping a key down after one press.
By Someguyoutside, with 4 replies.
Last reply by Someguyoutside, almost 7 years ago:
danpost wrote...
Someguyoutside wrote...
Here it is << Code Omitted >>
Add a boolean field to track which key set is currently being used: <Code Omitted>To change its value, use; <Code Omitted>Call the appropriate move/turn method with: <Code Omitted>The two code sets above would replace lines 23 thru 31
This seems to be working well. Thanks f
How to make a character shoot ONCE every time a key gets pressed?
By chipmunkrage, with 2 replies.
Last reply by chipmunkrage, almost 7 years ago:
Thank you! This worked great.
ayudenme :,c
By goku888, with no replies.
quiero hacer que dentro de la base haya columnas que no se puedan traspasar PD:no se si me explique bien :v
Im trying to make my actor move in a simple hour glass patern
By Faizcon, with 9 replies.
Last reply by SushiLlama, almost 7 years ago:
Faizcon wrote...
also what should i change my move(10) to?(like you said below) because this may be the reason the pattern does not work.
This should be no problem as long as you dont ask for things like if(getX() == 45) because getX() will never be 45 when moving in steps of 10.
SushiLlama wrote...
Moving in a rectangular shape given 2 integers
By iElucien, with 1 reply.
Replied to by danpost, almost 7 years ago:
iElucien wrote...
I'm very new to java and my instructor threw a curve ball at me telling me to have an object move in a rectangular pattern. I know that I need a constructor but I'm not sure about how to go about it.
You do not need a constructor -- all you need is an
act
method with a
move
command and four sets of conditions, one set per
turn
. HINT: make use of the actor's rotation as a condition in each set.
help, I need the sphere to move in the form of a random parable in the world
By cavencad, with 1 reply.
Replied to by danpost, almost 7 years ago:
In
Super Pang
, they seem to appear at a random x along the top, drop a short amount (straight down) and then randomly turn left or right as they begin to fall and bounce as with gravity and no drag, bouncing at slower speeds (not bouncing as high) as the size of the sphere gets smaller. Actually, the behavior of the largest spheres are very similar, if not the same, as the bombs and the coin (if that is what it is). It might be a good idea to have a class between
Actor
and the classes of these falling object, maybe called
Bouncer
so you do not have to write code multiple
AI for Enemy Tank in Tank Game
By SushiLlama, with no replies.
Since i want my game to be singleplayer (Player vs COM) i need a way to tell the Enemy (COM) what to do. For now i implemented a method so that he turns towards the player and shoots when the turret i aligned. But that seems unrealistic and is kind of boring to be honest. So i came to an idea: Why not use AI for this? I want to use some kind of library since i dont think im able to make one myself considering my skills. I want to train the tanks by maybe fighting COM1 vs COM2 with fitness points for surviving time / killing (i dont know what to choose???). Although Neural Networks are really mathematic i understand how they work. I want my Enemy to be able to turn his turret left or right and or shoot (3 outputs). This should be done by the input of the map with the player tank (and obstacles on it). This sounds like a not too hard beginning for playing with AI. I tried following an AI tutorial but i couldnt figure out how to implement that for my game. Also, how would this minimap like overview of the Enemy Tank look as a input? And how many neurons should i have for the hidden layer? In conclusion: I need a library / easy adjustable code for beginners two steer the enemy turret either left or right or even not turning it and shooting/not shooting. How would i choose my input type? How many neurons in the hidden layer are recommended? How do i let tanks train and how can i save some of the best as a cast for new tanks created in each game? Is saving some AITank of Generation x and mutating him for each game even possible? Thanks for any answer given!
How to set image of a class within an actor
By PowerDj, with 4 replies.
Last reply by PowerDj, almost 7 years ago:
Just tried this out and it worked perfectly, huge thanks!
Illegal State Exception
By AdiBak, with 1 reply.
Replied to by danpost, almost 7 years ago:
AdiBak wrote...
I'm trying to make my actor get removed from the screen when it crosses a world edge. However, I'm receiving an illegal state exception.<< Error Trace Omitted >> << Code Omitted >>
Use
else if
on lines 9 and 12.
166
167
168
169
170
171
172
X