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
Actor has to place a Track.
By ITStudent, with 5 replies.
Last reply by ITStudent, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 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, over 6 years ago:
Just tried this out and it worked perfectly, huge thanks!
Illegal State Exception
By AdiBak, with 1 reply.
Replied to by danpost, over 6 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.
Spawn players based on variable from another class
By Dormey, with 6 replies.
Last reply by Dormey, over 6 years ago:
Ok it works now, thanks for your help
How do i get Tank track tracers in Greenfoot
By SushiLlama, with 1 reply.
Replied to by danpost, over 6 years ago:
You have seen my
Tank Target Practice
scenario -- haven't you?
Got an error while trying to install the program
By Saereh, with no replies.
hello, I got an error saying installation package is not supported by processor type and I must contact the vendor. can anybody help me to solve this error?
Change the username
By KSH-Kinderkanti, with no replies.
Is it possible to change the username, once the account was created? I would like to keep my current username, but everything with lowercase letters, so that the kids can type it easily.
Tank Game Turret Rotation and Tank Movement Problem
By SushiLlama, with 19 replies.
Last reply by SushiLlama, over 6 years ago:
danpost wrote...
Line 13 would be necessary, else line 5 would be useless. However, it is not something you would do on each iteration of the loop; but, only after the loop completes. Switch lines 13 and 14
Works like a charm!!! Wow! Thanks again :D
166
167
168
169
170
171
172
X