He gets stuck on walls, also in the air when he does his little 10 pixel jump.
Here's a very basic way to make your character turn when he's moving. Assuming you have two images, imageOne and imageTwo.
GreenfootImage RightOne = new GreenfootImage("imageOne.png");
GreenfootImage RightTwo = new GreenfootImage("imageTwo.png");
GreenfootImage LeftOne = new GreenfootImage("imageOne.png");
GreenfootImage LeftTwo = new GreenfootImage("imageTwo.png");
public character()
{
/**
* Mirror the images for moving right horizontally.
**/
RightOne.mirrorHorizontally();
RightTwo.mirrorHorizontally();
}
public void move()
{
if(Greenfoot.isKeyDown("right"))
{
setImage(RightOne);
setLocation(getX()+2, getY())
setImage(RightTwo);
}
if(Greenfoot.isKeyDown("left"))
{
setImage(LeftOne);
setLocation(getX()-2, getY());
setImage(LeftTwo);
}
}
That's reallly basic but it should work.
Yeah I agree. I might change the speed of the balls deflating. I program on a dreadfully slow computer so the calculations are always off.
I was trying to find a sound to put in but I can't find the right one! I'll try to make one.
Thanks for the feedback bourne :)
Cool. The fan should only blow the balloon when it's within a certain range though. It would make it more realistic. When the balloon is at a given distance from the fan, the blowing effect should lessen, until there's none at all. Hopefully that makes sense.
The player jumps at a reasonable speed, but when he's falling, he should fall faster and have gravity assist him.
Eg.
public void gravity()
{
ys = 3;
setLocation(getX(), getY()+(int)ys); ys +=0.2f;
}
Hope that helps.
Congrats on getting on the front page =D.
Excellent game.
One question though, if you didn't import any images, how is the player image so abstract? I didn't think it would be easy to draw an image like that with Greenfoot...
2010/11/14
Scamper Ghosts
2010/11/13
Boom Shine
2010/11/13
Boom Shine
2010/11/13
Blowing the ballon
2010/11/13
NullGravity
2010/11/12
Biomekanoid Chicken
2010/11/12
Breakout
2010/11/12
Spawnlings
2010/11/8
Metal Mission