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
I need help on some code.
By MakerOfGames, with 1 reply.
Replied to by SPower, about 13 years ago:
If(getX() == aNumber && getY() == anotherNumber) { turn } That wasn't so hard, was it?
Adventure Game Collision
By RedPhoneBooth, with no replies.
Hey, I have just spent like 30 minutes working on a simple adventure game, its looking pretty good but now ive been stuck for a while with collision detection. I decided to make the cells 1 pixel so I have the freedom to make good looking and complicated scenery but the problem is I want the player to be able to go under bridges or partially under trees and stuff like that. So far everything ive tried just ballzed stuff up, so like I was wanting like a specific solid area for each object that I could "draw" into the world. Btw, im using the getX, getY, and setLocation methods for movement. Thx for the help! PS: Also, ive decided to scrap the idea of scrolling and go old school, u know, like the games where each screen was a new "area" that was mainly static and had the player walk from tile to tile, but how would I do somthing like that? I could have like shittons of World Classes and like switch between each one, but I could also just switch the background image between a two dimensional array in one world class, I might do that, but if you have any ideas... PPS: Sorry for the triple whammy of questions but I wouldn't mind creating multilayer as well, although I have no clue how to do so, how do you code servers and stuff like that? just give me the basic knowledge so I can decide weather its worth my time and effort to do cause that would be really fun but I imagine really hard to do. oh well, ill focus on single player for now.
TRacking ojects
By -nic-, with 4 replies.
Last reply by tkiesel, about 13 years ago:
My //comment above should have read close TO 90% of distance to target. Oops. ;)
How to get the hight and width of the computer screen?
By K_O_P, with 5 replies.
Last reply by ttamasu, about 13 years ago:
What tkiesel said works... All you need is the toolkit. Here is simple mock up, for instance: ---------------------- import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) import java.awt.Dimension; import java.awt.Toolkit; /** * Write a description of class goo here. * * @author Takashi * @version 1 */ public class goo extends World{ public goo(){ super((int)Toolkit.getDefaultToolkit().getScreenSize().getWidth(), (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight(),1); //Debug
online
By tylers, with no replies.
when are most people online
static
By tylers, with 3 replies.
Last reply by tylers, about 13 years ago:
thanks it works now
incresing varible
By -nic-, with 6 replies.
Last reply by -nic-, about 13 years ago:
gulp thx i have a look
Creating a nice looking counter
By SPower, with 9 replies.
Last reply by SPower, about 13 years ago:
@nccb Again, this it great. I won't go back using my own ScoreBoard, this is much, much better. Check it out if you want, I already updated it.
I need help with ememy Ai
By -nic-, with 8 replies.
Last reply by -nic-, about 13 years ago:
cant bye oh well just gotta work it out myself!
Move around an actor?
By nooby123, with 2 replies.
Last reply by nooby123, about 13 years ago:
Thank you very much!
Greenfoot bug
By Michionlion, with 4 replies.
Last reply by Michionlion, about 13 years ago:
danpost - that does work, although sometimes its just easier to close and reopen.
Switching between worlds.
By jam0037, with 5 replies.
Last reply by davmac, about 13 years ago:
There are some extra parentheses in danpost's suggestion that you need to remove for it to compile: <Code Omitted>
Player Chat Possible!
By DonaldDuck, with 2 replies.
Last reply by DonaldDuck, about 13 years ago:
The score updating for recency was actually bourne's idea that I implemented recently. The store() method seemed to be not storing properly during my initial testing, but it must have been a different problem in the code. Thanks for the clarification!
Crab tutorial - turn Greenfoot.isKeyDown() act/run
By rdlatimer, with 5 replies.
Last reply by SPower, about 13 years ago:
@rdlatimer I don't think you are right. When you press act, every object will run the action act(). When you press the run button, Greenfoot simply runs the act() action for every object in the world, the whole time. So actually, the run button in Greenfoot just runs a loop where every object will run the act() method. I hope this lets you understand Greenfoot al little better. (If you're wondering where I got this information: from the Greenfoot book)
Side Scroller
By woodkami, with 4 replies.
Last reply by davmac, about 13 years ago:
Well, I just need to know the concept on how a side scrolling map works.
Ok; you implement "scrolling" by moving everything to the left (or right). In Greenfoot this could be as simple as getting all the objects (World's getObjects() method) and then looping through them and adjusting their position. You should use an unbounded world so that objects can move out of the world bounds. It's a bit more complicated if you need the background to scroll as well, but to start with you could use a plain background to avoid that problem. This technique isn't particularly efficient, but
993
994
995
996
997
998
999
X