Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Jumping Jack 4K  (Read 3025 times)
0 Members and 1 Guest are viewing this topic.
Offline malberts

Junior Member





« Posted 2007-02-28 08:09:08 »

This is my first entry into Java 4K. I only heard of the competition about a week before the closing date, so I had rather little time to plan something.

The game is pretty basic and crude: you jump until Jack dies (or your fingers die, whichever comes first, heh).

I've uploaded 2 versions.
The Webstart one cannot keep high scores, whereas the JAR one can.

The keys:
Left/Right to move
Up to jump
Escape to exit
P to pause
S to stop game and record high score if you got one (Only works in JAR version).

Technical:
Everything is procedural.
Currently the things are drawn in hardcoded drawXXX statements. Is it possible (or feasible) to have, say, a String array where each String is of the form "(type) x x x x x x x x" where (type) is a letter (or number) for Oval/Rectangle/Whatever and the x's are coordinates. Then you'd have a single for-loop in the draw stage with a switch based on the first part of the String and then have the various drawXXX statements use the rest of the String as coordinates?

The Webstart file is 2,902 bytes, the JAR one 3,480 bytes. Now that's quite a difference seeing that the JAR only has an extra Scores array and a small part for reading/writing the high score info. Do you think it's worth it then to let the game keep high scores?

Both files are way under 4096 bytes but that's because I didn't really have much time to plan a good game. The source is plagued with a lot of duplicate if's and stuff. So I should be able to decrease the size even more.

This is the way I get my files as small as possible:
  • Compress with 7zip.
  • Obfuscate with Progaurd. (Are there better ones? Can 2 obfuscators be run on 1 file make it even smaller?)
  • Extract the obfuscated JAR and compress again using 7zip.

This basically changes my JAR size like this:
Compressed: 4,807 bytes
Obfuscated: 3,591 bytes
Re-Compressed: 3,480 bytes
Am I missing something by having to compress again, or is this the way ProGaurd works?
I realized now: after obfuscation the field names contain similar strings like java_whatever_whatever_ and that's why re-compressing decreases file size more.

Known Bugs:
When the player moves off screen, the wrapping isn't really correct. The part of the player going off the screen must appear on the other side but instead the entire player goes to the other side when it's completely off the screen. This sometimes cause a glitch when you run over a hole that is also partly off the screen.

Sometimes when the player jumps in a strange way the level numbers gets messed up and that makes the game unplayable.

Things I'd like to add:
  • More than 1 hole at later levels
  • Monsters at later levels that make you fall
  • Pick-ups that temporarily decrease hole speed

Remarks:
My logic tells me it's unnecessary to have lives?

The game's link: http://javaunlimited.net/games/launch.php?type=jnlp&id=165

In space no-one can hear you System.out.println()
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #1 - Posted 2007-02-28 12:17:38 »

Is the game supposed to appear on the list immediately after submission because mine hasn't?  Huh
No.  It has to be manually approved before it will be shown.  Don't worry though, as long as it is in before the deadline it will be accepted.

Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #2 - Posted 2007-02-28 21:54:52 »

Please, link to the game from this post (not directly, but via javaunlimited). Smiley
Now, I've tried it, and found a bug. If you jump up through the first hole and hold down the up arrow, you go up all the way and then gain one level per jump. Reached level 15 in about as many seconds. Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline malberts

Junior Member





« Reply #3 - Posted 2007-03-01 12:06:45 »

The bug I got was later on when the holes move faster and the character goes over the side and falls. The fall animation is then drawn on the line above the one where the player was. The player then falls back down to the level he was at. The level counter then goes crazy and the player can jump through the lines.

However I think your bug is a timer related thing. My processKEyEvent sets the key to be false whenever the key is released. Though even a quick press sometimes generates more than one such method call. So I placed an extra check in the UP button so that you can only jump after 850ms have passes since the last jump. I removed that just now and saw that if the holes are generated above each other then the players goes through them all. The hole generation part uses Math.random() and not a seeded Random. Should that make a difference to the X placement of the holes? They usually appear in some sort of pattern with the Math one.

Also, I didn't use FPS checking so if the computer gets slowed for some reason the whole game gets messed up.

Did you get that bug the whole time?

I've uploaded the source at http://www.javaunlimited.net/hosted/JJ4K/A.java if you'd like to determine how much of a masochist you are. Smiley My editor uses 2 spaces per tab so the layout might look strange.

In space no-one can hear you System.out.println()
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.

BurntPizza (21 views)
2014-09-19 03:14:18

Dwinin (35 views)
2014-09-12 09:08:26

Norakomi (62 views)
2014-09-10 13:57:51

TehJavaDev (87 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!