Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 4204 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:


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
Exp: 3 years

« 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  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (25 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (202 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (771 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!