Author Topic: Java 2D game development  (Read 1544 times)

Hillbillie

  • Jackass II
  • Posts: 69
  • Karma: +11/-0
Java 2D game development
« on: October 20, 2011, 12:55:24 AM »
Has anyone here messed with this at all? About 2 years ago, I got a basic custom engine working with Phys2D and was able to manipulate sprites with physical realness. It was neat, but that's about all.

About 6 months ago, I dusted off the code and got serious about making a game. It's a turn-by-turn strategy game, very similar to Worms World Party if you've ever played that. So far I've gotten the basic framework set up, a custom sprite format I/O based on ZIP (using TrueZip, which is awesome), a custom map format I/O also based on ZIP. Using XML as configuration data with JAXB (though after using Jackson at work, thinking of switching).

One of the big issues I have now (and did 2 years ago) was terrain traversal. The player's sprite is represented by a 2D physical object, and so is the terrain entity. To make the player's sprite walk, I simply apply a horizontal force in the direction desired. The issue has to do with my terrain polygon and pushing an object up a slope; even though the slope might be a slight grade, there could be segments in that slope that are steep, and so I guess the physics engine thinks the object cannot overcome them.
Reduced fat and now 100% pot free, but same great okay taste.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Java 2D game development
« Reply #1 on: October 20, 2011, 05:23:29 PM »
Years ago when I did my original Java work in college. Created a breakout clone with it. I did a little bit with the Java3D stuff too but then had my life ruined by enterprise development.
This signature intentionally left blank.

Hillbillie

  • Jackass II
  • Posts: 69
  • Karma: +11/-0
Re: Java 2D game development
« Reply #2 on: October 20, 2011, 10:39:58 PM »
What kind of enterprise stuff you doing at work, if you don't mind me asking?

3D stuff, of any kind, is too smart for me. :P I skimmed a couple chapters in one of the Java game programming books I have that briefly discussed the subject, but it seemed really... hard. 2D is enough of a challenge for me!

Yea so I may need to pick your brain, along with the other Java guys here, when I can get some free time from work to tinker with my game project. I don't think the issue is all that complicated, probably just need a fresh set of eyes to see the obvious. Did you tinker with any physics stuff in your breakout clone? Guessing you didn't...
Reduced fat and now 100% pot free, but same great okay taste.

hans

  • Guitar Addict
  • Jackass In Charge
  • Posts: 3523
  • Karma: +46/-18
Re: Java 2D game development
« Reply #3 on: October 20, 2011, 11:31:11 PM »
I did some collision detection stuff and ball bounce kind of stuff with velocity/acceleration and simple angle stuff for walls/paddle/bricks. It's been a long time since then though. I did get back into it a little bit when I was on a wiibrew kick. I had big dreams of writing a game for the Wiimote.

Now days I'm working at a "startup" (gobloomhealth.com) that is building a private health insurance exchange. Before that I was at another startup doing professional services kind of stuff writing IVR systems/mobile apps for business purposes using VoiceXML and before I left the APIs from tropo.com). The last project I was working on was a cloud based call distribution app (like a hybrid PBX/phone bank).
This signature intentionally left blank.

Hillbillie

  • Jackass II
  • Posts: 69
  • Karma: +11/-0
Re: Java 2D game development
« Reply #4 on: October 22, 2011, 02:19:42 AM »
Ah, see I'm using the physics engine to basically update the sprite's position on each update cycle. It's also responsible for collision detection. I think maybe I need to tweak the scale, because even extremely steep segments in the terrain polygon shouldn't prevent, a ball for instance, to be pushed over them when the overall slope is not very steep. When I get a chance maybe I can do a proper post on the problem and get everyone's input, it'd be great to push past the issue and get onto the game rules and other interesting stuff.

Honestly, that kind of stuff (insurance exchange, IVR systems/mobile apps, cloud stuff) is what I love working on. I especially love developing Web APIs--REST in particular--but anything Web based I enjoy. I did a few things in Android, simple stuff... I'm just not great at doing GUI type apps! I know I'm still starting out with it, but game development seems so much more harder, lol.
Reduced fat and now 100% pot free, but same great okay taste.