Java4K - Minimum Games, Maximum Fun!

View Game: Electron Golf 4k

Electron Golf 4k

By Duncan Horn, submitted on Jan 9, 2012
Min JRE version: 1.6
This game was submitted in the Java4K 2012 Competition.
Source code available! Show source code

(Click on game for focus)

You need Java installed to play this game.
You may use the button below to get it.

Get Java


This is a remake of a game I made and lost (didn't back it up) a few years ago. You are an electron with a -e charge and you have to maneuver yourself around the "course" until you reach the atom that is missing an electron (+e charge). You are propelled by an electromagnetic impulse and cannot move again until you come to a complete stop (the gun that provides the electromagnetic pulse isn't accurate or fast enough to act on a moving charge). Your world is populated by other charged bodies whose magnitude of charge is directly proportional to its radius and whose charge is indicated by color: red = positive charge and blue = negative charge. In layman's terms, you are attracted to red bodies and repelled by blue bodies and the bigger the body, the more you are attracted/repelled.

I am a supporter of the Open Source Movement, but I am even bigger supporter of competition, so code will be released at the end of the contest.

- Although smaller bodies have less charge, it is more difficult to escape their surfaces.
- It is often better if you go from one body to the next instead of going for a hole in one.
- Don't panic on hole 18. Also, it might help if you don't use full power.


Camera Movement:

Ball Movement:
Click and drag to set the power. Release to shoot the electron.
SPACE = RESET BALL (does not restart level; used in the event of a wild shot that is orbiting or reached terminal velocity, etc.)

The goal is to get the small white ball (the electron) into the hole (the yellow, positively charged atom).

Bug Fixes:
- The game no longer eats your CPU
- Added support for moving with UP, DOWN, LEFT, RIGHT as opposed to just WASD

User Comments

Total 11 comments:

#1 By Fezziwig Jan 14, 2012 at 19:23:07
Great game. Source code doesn\'t display for me :(
#2 By Duncan Horn Jan 14, 2012 at 23:21:12
Thanks. I set the source code to display once the contest is over.
#3 By Duncan Horn Jan 19, 2012 at 07:12:40
I meant to note this earlier, but my high score is 1 under par
#4 By Eddie Rich Jan 20, 2012 at 18:58:43
Fun game but, 1) space bar doesn\'t seem to do anything. 2) on a wild shot, the ball just drifts out into space, takes a loooooong time for the game to reset.
#5 By Duncan Horn Jan 21, 2012 at 20:56:40
That\'s what the space bar is for: to reset the ball \"in the event of orbiting or reaching terminal velocity, etc.\" If you take a wild shot, press space to reset the ball so you don\'t have to wait.
#6 By Duncan Horn Jan 22, 2012 at 07:15:02
Scratch that, 7 under par
#7 By Eddie Rich Jan 25, 2012 at 22:05:14
I guess I wasn't clear. When I press the space bar, nothing happens. The ball just keeps drifting off. I keep hitting the space bar, nothing happens. Eventually, after about 45 seconds, it resets.
#8 By Duncan Horn Jan 27, 2012 at 03:13:52
Ah, I get you. Does WASD work for you, or are those messed up as well?
#9 By Duncan Horn Jan 27, 2012 at 16:52:22
I just re-did my I/O, so hopefully it will work for everyone :D
#10 By Duncan Horn Jan 27, 2012 at 23:40:08
18 under par!
#11 By Eddie Rich Feb 1, 2012 at 18:55:52
Sweet, now I'll spend hours playing! Yes, your I/O change works, camera keys work and space bar works. Cool game, it's very addictive.

You need be logged in to write comments. If you need to register click here.

Source code

Note: We recommend you copy+paste this to a better editor. Some special character encoding may have been lost.