4K Pinball

Play Pinball

Download the source code

left arrow - left flipper
right arrow - right flipper
space - tilt
enter - new game
escape - exit game



Scoring and Bonus Rules
Bumpers and slingshots gives 1000 points. Dropdowns and rollovers 4000 points.

5000 bonus points for completing a dropdown or rollover group.

Completing the A, B or C drop target will ligth a bullseye
arrow. The bullseye bonus depends on the number of arrow lit:
0: 25 000
1: 50 000
2: 100 000
3: 200 000

Completing the multiplier rollovers will increase the multiplier. All bonus
scores are multiplied by the multiplier.

The inlane rollovers will lite the left lane arrow for 30 seconds. The bumper
rollovers will lite the right lane arrow for 30 seconds. The left and right
lane awards 25000 bonus point when its arrow is lit.

Hitting the bumper rollovers 3 times will enable the bumper bonus for 30
seconds. Hitting a bumper when the bonus is on awards 5000 bonus points.

Hitting the left lane 3 time will enable the rollover bonus for 30 seconds.
Hitting the right lane 3 time will enable the dropdown bonus for 30 seconds.
Hitting a rollover or dropdown when the bonus is one awards 10000 bonus points.

Completing the kicker dropdowns will light the coresponding kicker.
Triggering a kicker will kick the ball back and award 15000 bonus points.

Extraball is awarded when reaching the following scores:
1 000 000
2 000 000
4 000 000
8 000 000
16 000 000
32 000 000
64 000 000

Extraballs do not stack.

Hit anything that is blinking. Bonuses are shown by an object blinking. So
if it is blinking, try to hit it.

Go for the multiplier. Learn how to trap the ball on the left flipper. If you trap
it on the right flipper you can tilt the board to move it to the left. Then hit the
right lane to move the ball to the multiplier dropdown. Use tilt to complete
the rollover on the right.

Use the slingshots to hit the kickers and bumper rollovers. Use tilt to get
extra kick from the slingshots.

Use the tilt as much as possible to conroll the ball. But be careful, the board
is locked if you tilt two times in under half a second.


  • Vector based posteriori collision detection
  • Realistic collision repsonse
  • Rollover targets
  • Drop targets
  • Bumbers
  • Slingshots
  • One way gates
  • Tilt
  • Multiplier
  • Outlane kickers
  • 3 flippers
  • Bullseye skill shot
  • 5 time bonuses
  • Extraball

26.12.2007: webstart (4096 bytes).
13.12.2007: webstart (3896 bytes).
08.12.2007: webstart (3954 bytes).
03.12.2007: webstart (4026 bytes) (4024 bytes).
25.11.2007: webstart (4085 bytes).
22.11.2007: webstart (4075 bytes).
21.11.2007: webstart (4085 bytes).

Absolutely lovely!

Great work so far, one thing I noticed while playing was that it felt like the acceleration of the ball is a bit too fast and the friction too low.

Awesome stuff! ;D

Cool stuff! It’s tricky to see what’s what though; for example, you can’t see the flippers. Personally, I’d have liked just a little bit work on graphics instead of one or two of the flipper board parts. Good stuff though, looking forward to seeing it finalized.

I’ve a little something going on myself, but I’m waiting for the competition to start :wink:

Very cool!

You have managed to pack in quite a bit there and it is quite well balanced, with action and interaction.

Some ideas: It is a bit hard to guess what color of the lights is on and off, especially since they aren’t always lit when going over them. The ball did also go through the flipper a few times, when hitting it with the tip of the flipper. (Changed direction a bit). Would be nice to with some description of what does what (like what triggers multilpier and so on). I could still use flippers after tilting. Feature? :slight_smile:

Framerate seems to be good except for some hiccups from GC or possibly this:
java.lang.NullPointerException at java.awt.Component$BltBufferStrategy.revalidate(Unknown Source) at java.awt.Component$BltSubRegionBufferStrategy.validateAndShow(Unknown Source) at javax.swing.BufferStrategyPaintManager.show(Unknown Source) at javax.swing.RepaintManager.show(Unknown Source) at javax.swing.SwingPaintEventDispatcher.createPaintEvent(Unknown Source) at sun.awt.windows.WComponentPeer.postPaintIfNecessary(Unknown Source) at sun.awt.windows.WComponentPeer.handleExpose(Unknown Source) at sun.awt.windows.WToolkit.eventLoop(Native Method) at sun.awt.windows.WToolkit.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

All in all a great game and a good idea. I say that because I created one very similar to this last year :smiley: , but got too swamped to complete it on time. :stuck_out_tongue: Almost scary how similar they are. I created a “full version” of the same game available here. I was hoping to make it an applet using Slick, but I have a gfx card that doesn’t play well with Slick, so the project has sort of been dormant so it is not complete or bug free, but maybe fun to see the similarities anyway. Keys: Enter, right & left shift, q,w,e,r and 1 - 6 to drop balls at different places.

I worked a bit on the flippers on my 4K game, as Morre suggested to you, but improving it a bit does take quite a lot of work and mem! I think it would still be nice with different color for the flippers, so that they are a bit more distinct.

First good game already ready and competition isn’t even officially started. Looks promising.

PS. 2.195.100 (8x multi and saved ball once using tilt in drain shute)

Made a new version with thicker lines and a different color on the flippers.

I’ll see if I can make room for different colors on the different type of targets. Group targets should change color but single targets will not change. I see that it can be difficult to figure out what is what.

As you know, the flipper physics is very difficult to get right. I noticed in your game that the ball sometime got a little stuck at the end of the flipper. If I did not have the size restriction I would go for a sliding sphere priori collision detection. Then I would be sure the ball will not go threw the flipper. What I can do now is to increase the collision detection rate. I paint at 60 fps and update the physics at 120 fps. If I increase the physics rate to 240 the bug will be less noticable since the ball and flipper will travell half the length every update.

I’ve added a rules section on the website. There is a link in the first post.

Tilting will not freeze the flippers, but you will loose half of your score.

Wow I really like this. Just need to speed up a little and it looks like it’ll be great. Love the color fade on the bumpers and the physics overall. And it seems to have a fairly good balance for avoiding going straight down the gutter, which sometimes is an unfortunate issue in an otherwise good game.

Looking forward to the finished product!


Submit submit submit ;D

I’ve submited the game. Although it is not finished yet. Still got 70 bytes left :slight_smile:

I’ve fixed the NPException reported by jojoh. Switcted from currentTimeMillis() to nanoTime(). Hopefully it will make it run smoother on some configurations. I’ve increased to physics iterations to run at around 960 times a second wich will improve the flipper/ball collision detection. There is also many small changes since the last time I’ve posted (22.11). Animated score, extra ball bonus at 1, 2, 4, 8 milliion, colored groups, 3 flippers, outer lane kickbacks, guide arrows and bonus text.

Great improvement!

Every time you add stuff, the jar gets smaller! :smiley: Just keep going. Like the kickbacks! Any chance that they could be activated at start?

Framerate seems to have dropped a bit, but I guess that’s just the price for all the extra stuff and the better flipper collision. It is still ok though.

Just sound missing :wink:

Uploaded a new version where the kickback are activated at start. Also managed to reduce the jar size 2 bytes by rewriting a for to while:)

The framerate is capped to 60 fps. I can underclock my laptop to 1000mhz and still get 60 fps. Any less and the game slows down. The time is mainly spent rendering lines. The physics takes very little time. Had to change the physics parameters when I increased the phrequency. This might have caused the game to feel slower.

Added a a gradient background. After optimizing and using Moogies 4KJO utilite the jar size is down to 3954 :slight_smile:

Screenshot of current version:


The game is finally finished. I’ve updated the first post with a picture of the final playfield, scoring rules and a strategy section. I encurage everyone to try it again. Especially if you are a judge :slight_smile:

I’ve added a bunch of things since the last post. Tried to improve the graphics by shading the ball and adding some shadows. There is a flashing effect every time a bonus is awarded.

Added some time bonuses. The objects will blink when bonus is activated.

Now, I’ve got an idea for another 4k game I want to try out. See if I get the time.

Mary Christmas everyone!

Absolutely stunning, in only 4k! :o

Perhaps a tad easy, but other than that everything feels just right.

That was excellent. The physics is great, graphics are simple but good, runs smoothly, responsive to inputs.

Gameplay might be low, but hey it’s pinball, what do you expect. It’s fun, it keeps you occupied for a while, it does what a game is supposed to do.

Congratulations, well done.

The source code for 4K Pinball is now available.

I’ve included an ant script, so it should be ease to compile and run.

I’ve also included the level editor. The game is hardcoded to the existing level. If you want to create a new level from scratch you will also have to change the game. Although it should be possible to modifiy the existing level without the game breaking to much :slight_smile: