Sign Up, Lost Password
You need to login to take part
hi, how do I run my ball image using jbutton arrow and players img using keyarrows the panel1 is set in Grid layout .(java eclipse)
By Taeyo, with 6 replies.
Last reply by danpost, about 4 hours ago:
For help on your buttons, refer to
of the java tutoriaals. Also, you can review
that goes along with it.
Sharing a variable across actors
By Randomgreenguy, with 7 replies.
Last reply by danpost, about 5 hours ago:
Starting at the top: (1) Remove line 2 from both classes. It not a problem -- just not needed. The
package is always automatically included in your projects. (2) Line 8 in
class should not be made
is (or is something that would be) specific to each instance of
(or, to each crab actor). In general, a class describes an object, its states (property values) in fields and its behavior (actions) in methods. The
modifier is used for other functions and class/global state properties. (3) Lines 9 a
Rotate a „GreenfootImage“
By RcCookie, with 2 replies.
Last reply by RcCookie, 6 days ago:
Oops.. must have missed that method. Thanks anyways!
By Roshan123, with 20 replies.
Last reply by Roshan123, 8 days ago:
hey danpost, thanks a lot for the helping and suggesting me now it's not lagging anymore i think the problem was with the draw Oval, fill oval, setColor(rand color) when i changed it to a static image of the shield then it was not lagging anymore
Could u help 3 question scenario
By Sauravbasyalking12, with 1 reply.
Replied to by danpost, 9 days ago:
Please refer to
of the Java tutorials.
How to create levels of a game?
By ShauryaThapan, with 2 replies.
Last reply by danpost, 10 days ago:
Oftentimes, the inclusion of
fields (class variables) in your
class is sufficient to allow the game to become more difficult from one world instance to the next. Some
fields (class constants) can be used to describe the initial set-up of a "level". One
field (variable) would be used to track which level is current.
Acceleration, Collision and and Walljumps?
By Pumk!n, with 2 replies.
Last reply by RcCookie, 10 days ago:
To actually implement the moving system, you need to save your speed from frame to frame:
Methods and method signatures
By Ojhayvee, with 1 reply.
Replied to by danpost, 13 days ago:
What would be the method signatures for; 1. setLocation(); 2. getX(); 3. getY();
An example is given in the first section of
page of the java tutorials.
Not able to create a score counter
By Coder12341234, with 5 replies.
Last reply by danpost, 13 days ago:
The problem is that you have two (2) methods that could potentially remove the actor from the world, you call them unconditionally and they both require that the actor be in the world when called. You could use an if statement to place the condition of the second calling that the actor be in the world, as such: <Code Omitted>However, if you decide to rearrange things, it may cause issues again. Better, would be to start both methods,
, with the following line:
Need help with WBC-4 chapter 5 Greenfoot Homework!
By TheHDMICord, with 2 replies.
Last reply by TheHDMICord, 13 days ago:
That seems to have fixed the issue! Thank you so much danpost, you're an absolute lifesaver!
Why is this spawning in before I press "f"?
By Pumk!n, with 2 replies.
Last reply by Pumk!n, 13 days ago:
thank you so much, I am pretty new to this, so thanks
How can i change the background during game
By alicia007, with 1 reply.
Replied to by danpost, 14 days ago:
i want to change the background during my game at a specific action.
method or this
Newton's Lab: this(new Vector()) what does this mean??
By disassociated, with 5 replies.
Last reply by danpost, 14 days ago:
Can you open that up or give a hint about the concept where I can read more? The run sequence is like this right? Space/ Constructor Vector / Constructor SmoothMover / Constructor Body / Constructor
Let me just point out a thing here. When an
instance is created, it is created from the bottom up. All extending classes are built on their supers. So, when you create a body, the
portion is created before the
portion. Think of it as such that the
object inherits pre-defined traits provided by the
By Sauravbasyalking12, with 5 replies.
Last reply by Sauravbasyalking12, 15 days ago:
Thank you so much dan I got it
The jump should be made slower
By Flantox, with 1 reply.
Replied to by danpost, 15 days ago:
The one way that will most surely work is to use a smooth movement system on the actor so that you can use a "fractional" acceleration value. A slower than one acceleration will make your actor jump a bit higher, while doing so at a slower speed. See my
GQActor Superclass Demo
scenario for a demo (or download to look at or use). Adjust the gravity value, which is vertical acceleration, for the effect.