Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  Lander 4K  (Read 5348 times)
0 Members and 1 Guest are viewing this topic.
Offline KONI

Junior Member




Java games rock!


« Posted 2005-01-03 20:22:34 »

I am currently working on my 4K entry for the contest and wanted to share my current work:

http://www.martialartsmovies.net/lander.zip

Until now, I have 6996 bytes BUT I know where I can spare a lot. I am currently using for testing purposes an image with the map data and this takes already 948 bytes.

I also use 5 classes (first OOP, then optimise) and I could already squeeze them into 1 big class. I am also using long var and function names. I am also not compiling with -g:none.

I hope I can make some modifications to get under the 4K limit.

Until now, I have the following:

You need to control a space aicraft (currently a dot, I'm lazy) with limited fuel and you need to land it safely onto a landing zone. Each movement (boost, left, right) needs fuel and the amount of fuel is limited.

on my TODO list:

- get rid of that ugly level image and use a better system (perhaps random map generator)
- design a better aicraft, that dot just sucks
- squeeze everything into one file
- perhaps better game logic, more informations...perhaps more screens.
- perhaps use a life system where you have 3 lifes to get through some levels.
- perhaps a map editor (would not come with the 4K).
- the possibility to modify the gravity and the fuel amount at startup if using the random map editor.
- When playing the pre-defined maps, the gravity and the fuel amount will be contained in the map informations and will modify the level difficulty. Some levels will have huge gravity and a limited amount of fuel.

Until now, the game runs old-schoolish in fullscreen, 640x480@16.

This is my first try with such kind of things, so be polite Smiley
Offline KONI

Junior Member




Java games rock!


« Reply #1 - Posted 2005-01-03 20:29:32 »

Forgot to say:

You can press "Enter" at any moment when you crashed or disappeared, the game will restart. Forgot to print that message after the crash message.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #2 - Posted 2005-01-03 21:07:52 »

Hi Koni! It seems that there are still a few bugs to work out. My ship move about 2 pixels, then the message "You Crashed on the Surface" pops up. Hitting enter makes the message flicker. Also, "thrust" is misspelled as "trust". I'm on Mac OS X v10.2.6, 2 USB port iBook.

I can't wait to play the fixed version! :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregof

Junior Member




in code we trust


« Reply #3 - Posted 2005-01-03 21:11:50 »

Very nice! reminds me of the old days :-)
Looking forward to your enhancements!

Oh, and I tried it on debian testing.

// Gregof
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2005-01-03 21:41:13 »

Hi Koni,

Here's a few tips based on a jar -tvf of your file:

1. Don't use a package. That wastes a lot of space.
2. Shorter class names are good.
3. You should be able to use the Frame directly instead of embedding a panel.
4. There's no need for the "Manifest-Version" as long as you have two carriage returns. Just test with 1.5 if you're worried if you have it right.
5. Images don't need extensions. So "map1.GIF" can become "m".
6. Use SuperPackME for images! Grin (Ok, so that's a plug for my toolkit, but it's great if you have a lot of images and not a lot of space.)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline dranonymous

Junior Member




Hoping to become a Java Titan someday!


« Reply #5 - Posted 2005-01-04 02:21:08 »

I got the same you crashed message as jbanes.  Sad  It did appear to go into full screen mode with no problem though.  Smiley

I'm on a mac G4 with OS 10.3.7, 256meg.

Hey jb - On win you can alt tab between programs.  How do I do something similiar in mac land?  Another java app I tried went full screen, but was just black.  I couldn't figure out how to kill it or switch to the finder.  I ended up holding the power button down and rebooting.  Sad

Regards,
Dr. A>
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #6 - Posted 2005-01-04 03:19:30 »

Quote
Hey jb - On win you can alt tab between programs.  How do I do something similiar in mac land?


Try... (wait for it...) Apple+TAB. :-)

Most of the Windows shortcuts were stolen from the Mac. As a result, they tend to work the same on the Mac, except that you use the Apple key instead of the control key. A few minor differences:

End: Takes you to the end of the file
Apple+Right: Takes you to the end of the line.
Home: Takes you to the start of the file.
Apple+Left: Takes you to the beginning of the line.

Quote
Another java app I tried went full screen, but was just black.  I couldn't figure out how to kill it or switch to the finder.


Just hit Apple+Q next time. It's like Alt-F4 in Windows, but better. Grin

Java Game Console Project
Last Journal Entry: 12/17/04
Offline KONI

Junior Member




Java games rock!


« Reply #7 - Posted 2005-01-04 09:11:32 »

Quote
Hi Koni! It seems that there are still a few bugs to work out. My ship move about 2 pixels, then the message "You Crashed on the Surface" pops up. Hitting enter makes the message flicker. Also, "thrust" is misspelled as "trust". I'm on Mac OS X v10.2.6, 2 USB port iBook.

I can't wait to play the fixed version! :-)



Hm, this seems to be a problem with an incorrect collision-map. I am currently reading the image from the jar and then make a collision map based upon the color informations in the image. Perhaps something went wrong with that. I'll try to get that to work...but perhaps I am also going to implement the new map system right away so I can forget about the image.

I'll try to get a MAC to find the problem.
Offline KONI

Junior Member




Java games rock!


« Reply #8 - Posted 2005-01-04 09:15:04 »

A little update:

I am using a yellow color pixel on the image to mark the start location for the aicraft. I just saw that I forgot to put something in the collision map if the color was yellow, so perhaps the MAC VM initialises the int[][] not the same way as does the windows version Huh

I added the correct value for those yellow points and hope this will fix the problem ?

I've overwritten the old version, so: http://www.martialartsmovies.net/Lander.jar
Offline Abuse

JGO Coder


Medals: 11


falling into the abyss of reality


« Reply #9 - Posted 2005-01-04 09:31:58 »

yeah, I seem to remember encountering that issue way back in the 1st 4K competition.

If my memory serves, it initializes images to grey (or was it white....), not black.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline KONI

Junior Member




Java games rock!


« Reply #10 - Posted 2005-01-04 13:32:23 »

Some serious space improvements, now I have 3984 bytes and so have space left to improve things Smiley

What I want to improve now:

- better image for the rocket (less pixelated and needs to be transparent)
- better collision detection
- find a BETTER WAY to save the level data, if someone has a better idea which doesn't uses images then it would be a big help
- add more levels (if I manage to find another way to save the level data)
- optimise the images. On my laptop I don't have my specialised photo manipulation tools and therefor the size is still too big. Looking forward to get back home to save them optimised.
- get rid of the package name (some more bits)
- get rid of the image extensions
- add images for the flame burst when moving sidewards and using the thrust.

Could someone please test if it still doesn't run under Mac OS X ?
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #11 - Posted 2005-01-04 14:19:53 »

Quote
Could someone please test if it still doesn't run under Mac OS X ?


Nope, that version isn't going to work on a Mac. It's compiled with 1.5. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline KONI

Junior Member




Java games rock!


« Reply #12 - Posted 2005-01-04 14:54:28 »

Quote


Nope, that version isn't going to work on a Mac. It's compiled with 1.5. :-)


didn't know there wasn't a 1.5 release for MAC. gonna compile it with 1.4 tomorrow.
Offline KONI

Junior Member




Java games rock!


« Reply #13 - Posted 2005-01-05 12:20:36 »

still no 1.4 version but I got rid of the map image and implemented a new map generator which will randomly generate a new terrain to play with. You also got a launch and a landing zone now and you need to fly from one to the other.

I think the best way would be to go with a "xx successfull maps withouth crashing" and the fuel would decrease every map and the gravity would be random.

I don't see another possibility with a linear gameplay.

I'm also a little over the 4092 limit so I need to tweak some, expect the new version soon.
Offline dranonymous

Junior Member




Hoping to become a Java Titan someday!


« Reply #14 - Posted 2005-01-05 12:25:53 »

Tried this on my win box.  Still waiting for the mac version. Huh

Some thoughts for you -

- The gravity is WAY too strong.  After 10 - 15 tries, I just gave up in frustration.

- It seems like there might be a collision detection problem.  If you get going down too fast, you will go through the landing pad a bit.  The text says you hit the ground, but it should have detected the pad impact, IMO.

- The ship looks really pixelated.  Not sure why.  Are you stretching an image?

- You need some type of force indicator, so the person knows if they are in the right zone for touchdown.  I was able to almost land a few times, but apparently it was always too hard, so I just ended up crashing.

- You need to change the text from - You disappeared and where never...  to were never....

- You seem to have a good starting point.  It will be good to see the final version.  Smiley

- Burning fuel on up thrust, seems to use too much.  Maybe decrease the usage a bit.

HTH -
Dr. A>
Offline KONI

Junior Member




Java games rock!


« Reply #15 - Posted 2005-01-05 13:19:24 »

Here come's the new version (still 1.5 though, don't know how to compile for 1.4 with jdk1.5; perhaps javac -source 1.4  -target 1.4 or something).

First the file:

http://www.martialartsmovies.net/lander.zip

now the new changes:

- a new ship grafic, expect the version with the flame burst soon
- a new map generator for hours of fun
- 4017 bytes so I've got some bytes to spare for the level count system.

@dranonymous

thanks for all your great suggestions. As for the fuel problem, I was able to beat every generated level at the first try. My girlfriend needed the first time 10 tries and after that crashed 2-3 before landing.

I don't think it's a computer problem with different CPU speeds, I've got a 20 ms timer and fuel is used if space pressed during a frame.

I changed the text, now it is correct english. I will also indicate somehow when the ship is slow enough to land safely. I am used to the old Lander Game and therefor know how to navigate but perhaps it's too hard for beginners. Please try again and when it's still to hard, I'll double the starting fuel.
Offline weston

Junior Member





« Reply #16 - Posted 2005-01-05 18:19:31 »

pretty cool, one complaint though. The animation quality of ship moving is a bit poor, are you using double buffering? vsync? or maybe the framerate is just too low. I understand if you aren't doing these things because there is no room in your code, but if thats not the case then you may want to try changing something.

for(int i = 1; i > 0; i++)
{
System.out.println(i+" cups of java downed");
}
Offline qgpr

Senior Newbie




yawn


« Reply #17 - Posted 2005-01-05 19:20:43 »

i dont like the collision detection, i lost one when i shouldnt have (the "transparent" zones shouldnt count), i also got a free win though Tongue
Offline KONI

Junior Member




Java games rock!


« Reply #18 - Posted 2005-01-05 20:16:38 »

you mean the transparent zones of the aicraft ? Hm, a pixel perfect collision detection is to space-consuming, I only test the collision on the bounding box. As for the free win, how did that happen ?

Was the landing zone at the same place as the launch zone or what ? Because that shouldn't happen, I did pay attention to that.

@ everyone:

does anybody know how to compile with jdk 1.5 to be compatible with 1.4 ?

is it something like:
javac -source 1.4 -target 1.4 G.java ??
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #19 - Posted 2005-01-05 20:25:09 »

Quote
you mean the transparent zones of the aicraft ?


You could add a landing gear. That's how most Lander games get around that issue. :-)


Quote
does anybody know how to compile with jdk 1.5 to be compatible with 1.4 ?

is it something like:
javac -source 1.4 -target 1.4 G.java ??


Basically, yeah. Although using target is sufficient. i.e.:
1  
javac -target 1.4 G.java

Java Game Console Project
Last Journal Entry: 12/17/04
Offline born2snipe

Senior Newbie




oh goody....java games


« Reply #20 - Posted 2005-01-06 15:55:35 »

I didn't notice anyone else suggest this,but I would suggest setting a flag to enable windowed mode.

Just a thought....otherwise it looks to be coming along nicely.
Offline KONI

Junior Member




Java games rock!


« Reply #21 - Posted 2005-01-06 16:04:31 »

I've optimised the terrain generation code and gained some bytes here and there. I've added now exhaust fire when using trust and will be adding sidewards exhaust too.

The flag for fullscreen will be in the next version and the actual version is also 1.4 compatible.

Have fun.
Offline kevglass

JGO Kernel


Medals: 118
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #22 - Posted 2005-01-06 19:10:12 »

Great job! Plays nicely and has a funky look.

I'm not sure if you've updated it recently but it did seem very easy at the current version (I'm normally crap at lander games)

Kev

Offline KONI

Junior Member




Java games rock!


« Reply #23 - Posted 2005-01-06 19:57:16 »

I've updated it several times since people complained it would be too hard and couldn't land once after 10-15 tries.

I also think it is way too easy, I can safely land all the time without crashing once, even with the last version where there is a random gravity.

I have with the last version 4044 bytes and try to add a decreasing fuel meter with each successfull level.

The new version features:

- a life count (3 decreasing)
- a successfull level count
- fire exhaust fume for trust, left & right
- a windowed and a fullscreen mode

Enjoy !
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #24 - Posted 2005-01-06 20:34:08 »

I like the new landing gear and the flames (haha Grin).

The only thing which is missing is some difficulty-ramping-magic which could be done with the leftover bytes Smiley

弾幕 ☆ @mahonnaiseblog
Offline wiesi

Senior Newbie




Java rulez!


« Reply #25 - Posted 2005-01-29 15:01:51 »

I modified your game a little bit, now it has 4.004 Bytes:
http://members.aon.at/witze/lander.jar

WiESi
Offline wiesi

Senior Newbie




Java rulez!


« Reply #26 - Posted 2005-01-30 11:29:31 »

Now 3.967 Bytes: http://members.aon.at/witze/lander.jar

WiESi
Offline dranonymous

Junior Member




Hoping to become a Java Titan someday!


« Reply #27 - Posted 2005-01-31 13:51:53 »

Its much bettter than the last time I checked on it!  Smiley

I like the new ship and thrust it has.  The lives is also a good addition.  The animation is nice and smooth. Somethings I thought of -

- Make a gradient background to jazz the screen up

- Is there any way to make the terrain more smooth?  It looks too blocky.  If you wanted those rectangles to be tall buildings and you are trying to land on a landing pad on them, it would make sense

- It doesn't seem fair to 'kill' the ship when it touches the top of the screen.  Usually lander games let you go off and then gravity eventually pulls you back down.  Maybe let them fly off the side and die though.

- What about 2 landing sites.  A large and small one?

Keep up the great work!

Dr. A>
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.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (33 views)
2014-07-14 16:23:47

Riven (34 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!