This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

programmer274
programmer274 presents ...

2013/5/17

My Game

A cheesy arcade style fighter game

1973 views / 12 in the last 7 days

Tags: game with-source

open in greenfoot
Your browser is ignoring the <APPLET> tag.
GusGus

2013/5/17

How much help do you need? I downloaded your game and the first thing I noticed was that the players could slip through the ground. I simplified this by making one ground object. You can add the following code and then adjust the addObject() in your world class so that you spawn one groung (X-coordinate 250). public Ground() { GreenfootImage image = new GreenfootImage(400,10); image.drawRect(0,0,400,10); image.setColor(Color.RED); image.fillRect(0,0,400,10); setImage(image); }
GusGus

2013/5/17

Oh, looks like that wasn't the problem, but you should still add that. It cleans things up a little bit.
danpostdanpost

2013/5/17

@Gus, your code extends the ground object to the edges of the world, which was part of the problem. The other part was the height of the ground, which you did not account for. public Ground() { GreenfootImage image = new GreenfootImage(400, 50); image.setColor(Color.RED); image.fillRect(0, 0, 400, 10); setImage(image); } You will need to add 20 to the y-location of where the ground is added into the world to get the top edge of the ground at the same location as it was previously.

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.