Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Operation Santa  (Read 1980 times)
0 Members and 1 Guest are viewing this topic.
Offline Rorkien
« Posted 2013-02-13 01:36:44 »



2 months off-season and i was beggining to get sick of it, but it's finally here, folks, have fun!

Play here! or Grab the JAR here!

Quick info about it:
-You play using arrow keys to move, and A to shoot;
-You don't shoot without ammo (so try to conserve it);
-You must save ALL the santa helpers (the guys in green and red) to be able to exit;
-Killing the black guys are optional, but if you touch them, you die;
-You have infinite lives, but there's no checkpoints. When you die, you go back to the start of the level.
-Points are optional, try to reach 100% if you are a tryhard;
-7 levels, with some kind of boss at the end.
-Music wasn't composed by me, but i don't even know who did it (lmao)

Valuable quotes and impressions:

"THIS MOTHERF**KING SANTA CAN'T SWIM FOR S**T WTF" - Some friend

Developer-point analysis

This is probably my last game in Java2D. It's a fun, easy and all-around lib overall, but as you strive deeper into it, you see flaws and incapabilities.

Well, about the game. I was planning on making a some sort of Commander Keen/Dangerous Dave mashup, with a Christmas theme. I had ZERO experience on how to create a platformer, but i tried anyway;
I knew i had to use an array for the tiles. I set up everything nicely, with a camera moving instead of the world. Then the first question appeared. What about entities and world collision?

Again, i had no idea on how to create a platformer. My first thought was about assigning a tile to an entity, and do collisions based on the same array i used to assign the world. Result: If i wanted to fall down a gap, i'd need to move to the exact point where the tile below is empty. With a tile being 32x32 pixels and the entity being around 24x12, you don't need to be a math genius to realize you'd be flying around pressing left and right looking for that exact pixel where i would be able to fall down.

At this point my player code was full of hacks of magically-set numbers. Welp.
Some time later i thought: Why not use hitbox-based entities instead of tile-based entities? 1 hour later i had refactored the entire entity hierarchy with simple methods and clean code, working smooth as butter, and, suddenly, pickups, snowballs, creatures were suddenly precise and working as intended. Welp

Then for the next subject: Level generation.
The levels are just PNGs with the tile data on them, divided in 3 layers: Tiles, Background, and Entities. The game loads those images, convert the color data into tiles, selects a texture that is appropriate, depending on the tile and it's position, and that's it. So, in some way, the levels are automatically generated. Which is something cool, to be honest. But the downsides are something to be frowned upon as well:

Firstly, you can't hard-code a certain texture into a certain position (well, you can, but it wouldn't be a good practice);
Secondly, tile divisions are harder to do and almost never end up as expected, since you have to check the adjacent tiles to determine which texture should be in place;
Thirdly, code gets ugly and hard to read.

To fix this? Well, i could set up a different color for every texture, and then draw those colors to form a map. Madness? Indeed. In a world of game with miles and miles worth of levels, why would i resort on this painful and unproductive method of drawing little points on the screen? Yet i decided to stick with it. And start thinking about a custom level format.

However, this got me sad. Sad enough for me to rush the rest of the levels, skip some tilesets (and thus, levels) and just worked on the ending. About the ending: I thought the "boss" art was pretty cool, and i'm even considering on reusing some stuff in an improbable sequel. Who knows? Until the next Christmas.

Have fun!
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #1 - Posted 2013-02-13 10:40:37 »

Very cute. I didn't make it through the entire game though - just enough to try it.
It seems to run much slower underground for some reason. This could be Java2D's fault.

You had some problems with laying out the correct tiles, based on neighbors? I assume you fixed that.
Else, I'd have asked if you're familiar with bitwise tilemapping. Smiley

Nice, well polished game. Could do with some sounds, and it wouldn't be too much work. Bfxr is your friend. Smiley

Offline Rorkien
« Reply #2 - Posted 2013-02-15 19:14:04 »

Thanks Cheesy

Yeah, i just used Java2D for simple graphics, since i was more focused on the platformer logics. I'm probably gonna try something else for the future (most probably libgdx).
As for the sounds, i was trying some 16-bit FM emulation. But i found out it doesn't fit modern games that much (which is not a big surprise: 8-bit chiptune music are never fully 8-bit)

Lastly, i never had problems with the tilemapping, it was just plain ugly and very unfriendly, but it works okay. Alas, thanks for the link; Even if i plan creating/using a custom map format that would save the tiledata instead of automapping them when loading (Tiled is an option, but i don't like how it manages the tilesets), there's always a small bit of "terrain" generation on little things (like grass, rocks, decorations and other stuff).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Sammyster

Senior Newbie


Medals: 1



« Reply #3 - Posted 2013-02-15 19:40:42 »

Gave it a try aswell. Really cool and polished game I must say.
Didn't beat it yet though but I will Smiley


Nothing to complain on except for a few more sounds as Mads mentioned perhaps.
Else it ran very well and surprises me how you got java2d that stutter free Wink
Offline Vendettaseve

Junior Newbie





« Reply #4 - Posted 2013-02-18 00:47:55 »

Great job mate, I really enjoyed it Smiley
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (49 views)
2014-10-17 03:59:02

Norakomi (38 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (34 views)
2014-10-15 16:18:58

TehJavaDev (65 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (54 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!