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
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, about 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, about 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.
Spawn players based on variable from another class
By Dormey, with 6 replies.
Last reply by Dormey, about 7 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, about 7 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, about 7 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
Moving HP bar
By andrewchin, with 3 replies.
Last reply by danpost, about 7 years ago:
I am not sure why you do not get an error on line 55. I would think it needs to be: <Code Omitted>Out of curiosity, are your
hpbar
images animated? Just wondering because of the
gif
suffix. Please provide
hpbar
class codes.
One object (car) is hitting another Object(house). House will move after hitting. Car will vanish.
By spaceskull, with 4 replies.
Last reply by spaceskull, about 7 years ago:
thank you so much
Number of objects in a list
By Bikey16, with 2 replies.
Last reply by Bikey16, about 7 years ago:
Oh thanks, I'm so blind.
How to achieve Line Of Sight
By SickTrickz832, with 24 replies.
Last reply by SickTrickz832, about 7 years ago:
danpost wrote...
SickTrickz832 wrote...
Ok, I changed the background image size to 800 x 800 and changed the world size to 800 x 800. The player now 'spawns' in the center of the world. However it doesnt stick to the center and the world doesnt scroll, the player just walks off screen
No -- do not do that. Just replace lines 15 and 16 with: <Code Omitted>
Gave it a go, works perfectly. Only think i gotta do now is make it so the actor doesn’t walk offscreen, and all other actors, like obstacles and pickups, move as well. Thanks for your hel
My code doesn't move to the actual minigame from the title screen
By sjyang24, with 1 reply.
Replied to by danpost, about 7 years ago:
I am surprised that it compiles at all, as you do not seem to be importing
greenfoot.*
at all.
Replace Greenfoot.delay() with a clock/timer to prevent freezes
By SushiLlama, with 22 replies.
Last reply by SushiLlama, about 7 years ago:
Wow thank you! And there wont be any delay? The opponent and I can move even while we are dropping bombs? Thats awesome! Ill try to improve my game further. For now i got no more questions. Ill come back if that changes. But for now i really want to thank you for your kind help! I really apreciate it! <3
Choosing Characters
By CodingCowgirl, with 8 replies.
Last reply by CodingCowgirl, about 7 years ago:
Ok.
167
168
169
170
171
172
173
X