Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
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  
  PWM (Pulse Width Modulation) 2D Game  (Read 1713 times)
0 Members and 1 Guest are viewing this topic.
Offline LeoOno
« Posted 2020-02-18 03:40:16 »

Hello everyone !

No big deal, but here is my first "original" 2D game: PWM (Pulse Width Modulation)

Basically, the goal is to press or release the space key to generate square wave pulses (in blue) and keep the white small ball on the screen (representing the speaker diaphragm's level) as close as possible to the yellow wave.

The ideia was based on this video https://youtu.be/4SBUrv7fXqI

Implemented in java 8 using just standard libraries (java 2D, Swing, AWT), so no external libraries required.



Keyboard Controls:

[Space] key: move the ball up or down


Thanks Smiley !


Link to download Runnable Jar [java 8]: https://github.com/leonardo-ono/JavaPwmGame/raw/master/dist/JavaPwmGame.jar (13.4KB)

Source code: https://github.com/leonardo-ono/JavaPwmGame


Video

 <a href="http://www.youtube.com/v/S7eLh4NCEd4?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/S7eLh4NCEd4?version=3&amp;hl=en_US&amp;start=</a>


Screenshots






Offline SugarBlood
« Reply #1 - Posted 2020-02-18 11:26:17 »

"Original" game this time Cheesy There is an interesting source of inspiration Cheesy

Well, it was hard, this is my best try:



Looks like everything works fine, by the way.
Offline LeoOno
« Reply #2 - Posted 2020-02-20 14:40:51 »

hello @SugarBlood, very nice score ! thanks for the kindness of always testing my games Smiley
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Abuse

JGO Ninja


Medals: 73


falling into the abyss of reality


« Reply #3 - Posted 2020-02-20 18:49:48 »

Any chance of:

a) fullscreen/resolution change
b) rebindable inputs (specifically, use a mouse button instead of keyboard key).

It'd make it a lot more tolerant of hardware variance. (and would eliminate a couple of excuses for me being so bad  Pointing)
Offline SugarBlood
« Reply #4 - Posted 2020-02-22 16:15:54 »

@LeoOno, no problem, you're welcome Grin This is not taking too much time Smiley

Quote from: Abuse
rebindable inputs (specifically, use a mouse button instead of keyboard key).

I don't know about that, but different key instead of space, would be nice, like CTRL.
Offline LeoOno
« Reply #5 - Posted 2020-03-01 01:21:41 »

@SugarBlood, @Abuse, very nice suggestions !
as i was implementing only old games, i forgot that there is a mouse input xD ...
i'll see what i can do later, but now that you mentioned, i was doing some tests and i can't get the full screen work work in linux Sad
well thanks for the feedback Smiley
Pages: [1]
  ignore  |  Print  
 
 

 
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!