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
Hockey Game Boundary Collision Problems
By camsterb, with no replies.
Hi. I'm looking for a formula to use to change the trajectory of a hockey player bouncing and sliding around a rectangle through use of the inbuild move method. <Code Omitted> This method seems to work perfectly, but sometimes the player manages to get stuck beyond the boundaries. The object rotates left and right with keypresses. It moves in the direction in is facing. Maybe it's to do with turning the object while bouncing off a wall? Anyway, here is the link to observe what I mean: http://www.greenfoot.org/scenarios/7181 I'm looking for criticism of my method and advice to solve my problem of moving beyond boundaries. Thanks As an additional question: I want to be able to shoot the puck and give it the current rotation of the hockey player. This allows the puck to move that direction. I have some code already for this, but there are glitches. I will post more details at request. All the code is visible in the link.
Compile error?
By erdelf, with 4 replies.
Last reply by erdelf, over 12 years ago:
oh damn, I know what the problem is, I forgot for a moment that the string class is an actual class and wrote a new class called String, sry for bothering you
actor not in world
By KierTulp, with 1 reply.
Replied to by KierTulp, over 12 years ago:
I just fixed the magnet one, it was because I had the getX() and getY() thingies in there.
Need help please! re adding a removed object
By ddavid33, with 5 replies.
Last reply by LordBeno, over 12 years ago:
oh my bad xD
All Nighter
By BradH, with 10 replies.
Last reply by danpost, over 12 years ago:
Ctrl-Shift-I properly indents your code (it is the shortcut for Edit>Auto-layout within the code pane).
How is the world divided in cells? Problems with getObjectsInRange()
By JimmyFake, with 7 replies.
Last reply by JimmyFake, over 12 years ago:
I had some time, to try out what you posted danpost. My assumption was right, even though I may have expressed myself, incorrectly. For now the ObjectsInRange method works better for me, because an circular radius is fine for now, and the code is simpler. And thanks to GevaterTod, I do now know, how to use that command :) But if I want to adapt the area of the radius, because of some reasons that might appear in future, your advice would come in handy, danpost. Thank you both, again :D
How do I get the direction an Actor is moving?
By Oxy, with 3 replies.
Last reply by Oxy, over 12 years ago:
yup, that was what the problem was thanks danPost
incompatible types
By KierTulp, with 13 replies.
Last reply by vonmeth, over 12 years ago:
Edit: nm
incompatible types with range
By KierTulp, with 2 replies.
Last reply by Gevater_Tod4711, over 12 years ago:
If you want to prove if there is an object type uman near you, you should change the method like this: <Code Omitted>
How do you set the world using buttons that the mouse clicks on?
By LonelyCreeper, with 2 replies.
Last reply by LonelyCreeper, over 12 years ago:
Oh I solved it. Thanks anyways though.
How to set world at beginning of game
By LonelyCreeper, with 2 replies.
Last reply by LonelyCreeper, over 12 years ago:
Thanks!
Image comparison
By Minion1, with 3 replies.
Last reply by danpost, over 12 years ago:
You could set up an array to map the world. It could be of 'int', 'String' or 'char' type (guess it could even be of 'Class' type -- not that I would recomend it). This map could be used not only to create the initial background, but also to determine what is where during game play. Another possibility is to use color detection to determine what is where. This would involve breaking the color up into its primary color components and checking the values for certain ranges to distinguish between the different types of terrain (brown=mountain, blue=water, tan=dirt, green=grass
Gravity
By sametguzelgun, with 2 replies.
Last reply by sametguzelgun, over 12 years ago:
Thank you.
ifOnGround() won't work??
By AnneMacaroni, with 1 reply.
Replied to by AnneMacaroni, over 12 years ago:
btw, is there a way to delete discussions?
Making loop for an animation of 100 images in series
By camsterb, with 3 replies.
Last reply by camsterb, over 12 years ago:
Hi. Yep, just putting in +i+ between closed quotations worked very nicely. Thanks a lot for the clarification and the hard work as always! :D
898
899
900
901
902
903
904
X