Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Laser Pinball  (Read 7816 times)
0 Members and 1 Guest are viewing this topic.
Offline zeroone
« Posted 2012-01-02 11:28:01 »

http://meatfighter.com/java4k2012/laserpinball/



Above is Video Pinball for the Atari 2600.  I wanted to code a port of it, but the project morphed into something more interesting.
Offline Damocles
« Reply #1 - Posted 2012-01-02 11:41:31 »

Really nice pinnball sim. I like the halo-effect.
And big thanks for the clean sourcecode.

PS: please remap the "quote" key and use "L" for example, as not everyone has the US-english keyboard-layout.

Offline zeroone
« Reply #2 - Posted 2012-01-02 11:45:47 »

Quote
PS: please remap the "quote" key and use "L" for example, as not everyone has the US-english keyboard-layout.

Where's Quote on your keyboard?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Damocles
« Reply #3 - Posted 2012-01-02 11:48:09 »

Swedish and German keyboards have the quote at "shift-2" for example.

The L is pretty much the same on all keyboards.

Offline zeroone
« Reply #4 - Posted 2012-01-02 11:52:26 »

Quote
Swedish and German keyboards have the quote at "shift-2" for example.

I think that's double quotation mark, not single quotation mark, the one that also works as apostrophe.
Offline Damocles
« Reply #5 - Posted 2012-01-02 11:56:03 »

anyway, I can only press the key while pressing shift,
or you could also use the cursorkeys as second alternative.
(I usually -try to- use several alternative keymappings in games, for left and righthanders, so everyone is happy)

Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2012-01-02 12:01:11 »

O___O HOW IN THE WORLD DO YOU FIT COOL GRAPHICS AND PHYSICS IN 4K!?! Zeroone you must be some kind of wizard.

Great game and great job, I got to 6,390,000 points Cheesy

EDIT: The a.class file is 22.5KB O_o
EDIT2: Also how did you create that glow around the walls using Java2D?

Offline ReBirth
« Reply #7 - Posted 2012-01-02 13:03:27 »

Nice gfx!
He's not wizard, but Chuck Norris.
Please answer ra4king's question number 2~

Offline dapy
« Reply #8 - Posted 2012-01-02 17:36:48 »

Fantastic! I managed 25,520,000 points...

Zeroone you must be some kind of wizard.

I think 'genius' is the word you're looking for  Smiley

EDIT2: Also how did you create that glow around the walls using Java2D?

I believe he/she renders the same shape in a loop, decreasing shape size while increasing alpha for each iteration. Here is a pertinent example from the source code:

1  
2  
3  
4  
5  
6  
    // create ball sprite
    g = imageGraphics[IMAGE_BALL];
    for(j = 63; j >= 0; j--) {
      g.setColor(j == 0 ? Color.WHITE : new Color(255, 0, 0, (63 - j) >> 3));
      g.fillOval(65 - j, 65 - j, 39 + (j << 1), 39 + (j << 1));
    }
Offline fruitmaze

Senior Devvie


Medals: 3
Projects: 2



« Reply #9 - Posted 2012-01-02 18:48:37 »

Awesome! I love the graphics!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #10 - Posted 2012-01-02 18:54:18 »

The choice of a and ' is rather unfortunate, because depending on your localization the ' will trigger only 1 keyPressed event (it will 'wait' for another character, to combine them into á,é,ó etc etc)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline StephR

Senior Devvie


Medals: 9



« Reply #11 - Posted 2012-01-02 21:01:33 »

Very impressive ! This pinball doesn't feel at all like if it was made in just 4 Kb.

However, I have to complain about controls, as I was not able to find the key for the right flipper on my AZERTY keyboard...
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #12 - Posted 2012-01-02 21:13:51 »

It would be MUCH easier to change this to the left shift and right shift by using VK_SHIFT and then keyEvent.getKeyLocation() == KEY_LOCATION_LEFT or RIGHT

Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #13 - Posted 2012-01-02 23:21:17 »

Swedish and German keyboards have the quote at "shift-2" for example.

The L is pretty much the same on all keyboards.

Add danish and norweigan ones.

Offline luisoft

JGO Coder


Projects: 6


Java games rock!


« Reply #14 - Posted 2012-01-03 11:22:01 »

The choice of a and ' is rather unfortunate, because depending on your localization the ' will trigger only 1 keyPressed event (it will 'wait' for another character, to combine them into á,é,ó etc etc)

This is happening here. In ABNT2 (Brazilian keyboard) it waits for another character...

Anyway this is just a very simple change. I agree that using SHIFTs are the best option for pinball games.

zeroone and kevglass are the best 4k coders!!! And the best is that they share their source code! At least we can try to learn from it.

Offline zeroone
« Reply #15 - Posted 2012-01-03 15:02:06 »

The choice of a and ' is rather unfortunate, because depending on your localization the ' will trigger only 1 keyPressed event (it will 'wait' for another character, to combine them into á,é,ó etc etc)

This is happening here. In ABNT2 (Brazilian keyboard) it waits for another character...

Anyway this is just a very simple change. I agree that using SHIFTs are the best option for pinball games.

Many apologies to all for the bad choice of keys.  Originally, I provided several alternative key mappings.  But, I was running low on bytes and many features were dropped.

The left and right shift keys would normally be my top choice, but under Windows if you press Shift 5 times in a row it enables StickyKeys.  The arrow keys and WASD/ZQSD are not good options either because I want to involve both hands as you would with a real pinball machine.  A and L are problematic on AZERTY keyboards since the keys are on different rows.

I would appreciate further suggestions before I change the mapping.  Thanks ahead of time to all.

Great game and great job, I got to 6,390,000 points Cheesy

EDIT: The a.class file is 22.5KB O_o
EDIT2: Also how did you create that glow around the walls using Java2D?

Congrats on the high score, but dapy destroyed you with more than 25 million points.

I put the uncompressed class file onto my web page to avoid pack200 issues.  The gz file is currently 2 bytes under the 4K limit.

As described correctly by ra4king, it is generated by a loop that redraws the lines repeatedly with decreasing thickness and increasing color intensity.   

 
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #16 - Posted 2012-01-03 15:14:22 »

Hehehe it was actually dapy that described the "glow" effect.

And now how about Left and Right Ctrl keys?

EDIT: Hehehe I played again and got 9,275,000 points. How many features are there in this game?! I suddenly got 2 balls rolling around, don't remember exactly what I did for that to happen :S

Offline zeroone
« Reply #17 - Posted 2012-01-03 15:38:41 »

Hehehe it was actually dapy that described the "glow" effect.

And now how about Left and Right Ctrl keys?

EDIT: Hehehe I played again and got 9,275,000 points. How many features are there in this game?! I suddenly got 2 balls rolling around, don't remember exactly what I did for that to happen :S

Oops!  You're correct.  Dapy's the man.  He currently has the high score and he knows his loopy glow effect.

On some reduced keyboards, there is only one Ctrl key and it may be found in a strange location.  It is the same deal with Alt. 

Collect all 5 white rollover targets to release extra balls onto the playfield.
Offline Groboclown
« Reply #18 - Posted 2012-01-03 19:15:05 »

Very nice game.  I especially like the hard-to-get multi ball feature.

Offline ReBirth
« Reply #19 - Posted 2012-01-04 13:39:50 »

Quote
As described correctly by ra4king, it is generated by a loop that redraws the lines repeatedly with decreasing thickness and increasing color intensity.  
it means to make a yellow more yellow? Huh

Offline Damocles
« Reply #20 - Posted 2012-01-04 13:53:41 »

Its a halo effect.
I used something similar for these energy blobs in Cave4k.

You simulate the light reflecting from the underlying surface near bright lamps, thus getting this neon look.

Offline machinezilla

Senior Newbie


Projects: 1



« Reply #21 - Posted 2012-01-05 16:10:15 »

very cool.
Offline pelle

Senior Devvie


Medals: 3
Projects: 1



« Reply #22 - Posted 2012-01-05 19:17:49 »

Very good.

My first thought was "quote key is never going to work on my Swedish keyboard", but it did. Maybe because it is a Apple keyboard, not a PC keyboard.
Offline Ranger
« Reply #23 - Posted 2012-01-06 23:28:53 »

Awesome fun!  20,000,000 and balls going everywhere!  Cool
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #24 - Posted 2012-01-06 23:59:45 »

HA! I just played again, I beat you all!! 34,015,000!! W000T!!

Offline zeroone
« Reply #25 - Posted 2012-01-07 20:06:58 »

I provided an alternative key mapping that should make the game easier to play on various keyboard layouts.  Details and the updated game are posted here:

http://meatfighter.com/java4k2012/laserpinball/

Thanks again for your feedback everyone.

HA! I just played again, I beat you all!! 34,015,000!! W000T!!

Way to go ra4king!  You currently hold the High Score.
Offline zeroone
« Reply #26 - Posted 2012-03-10 18:40:46 »

Several people have commented to me about the instructions: TL;DR. 

To unlock multiple balls, collect all 5 white circular targets, which are scattered throughout the playfield.  Each time you collect the set of gray targets in the upper-left, the score multiplier gets incremented.  And, when you obtain all the gray targets in the lower-left, you earn a lot of points.

Originally, the playfield was full of glowing and blinking arrows, directing the player where to aim next.  Unfortunately, that feature along with a spinning target and a custom font designed to resemble a DMD had to be dropped during the great 4K crunch.       
Offline StephR

Senior Devvie


Medals: 9



« Reply #27 - Posted 2012-03-11 21:30:45 »

I can't wait to see more of your improved remakes, zeerone, as this one was really brilliant. But please spare Activision's Laser Blast, as I intend to work on it for a 12/21/2012 release.
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #28 - Posted 2012-03-11 23:33:10 »

I can't wait to see more of your improved remakes, zeerone, as this one was really brilliant. But please spare Activision's Laser Blast, as I intend to work on it for a 12/21/2012 release.
The Mayan calendar didn't account for leap years, so the world should have actually ended over 7 months ago Grin

Offline ReBirth
« Reply #29 - Posted 2012-03-12 13:09:45 »

Still wondering how to create this glowing effect.

I found a bug, where the ball stucks and couldn't move. http://dl.dropbox.com/u/54138920/img/pinball%20bug.png

Pages: [1] 2
  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.

trollwarrior1 (29 views)
2014-11-22 12:13:56

xFryIx (71 views)
2014-11-13 12:34:49

digdugdiggy (50 views)
2014-11-12 21:11:50

digdugdiggy (44 views)
2014-11-12 21:10:15

digdugdiggy (38 views)
2014-11-12 21:09:33

kovacsa (62 views)
2014-11-07 19:57:14

TehJavaDev (67 views)
2014-11-03 22:04:50

BurntPizza (64 views)
2014-11-03 18:54:52

moogie (80 views)
2014-11-03 06:22:04

CopyableCougar4 (80 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!