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  
  Super Spineboy  (Read 2432 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Posted 2014-05-09 11:26:29 »



--> Download the JAR now! <--

Controls: A/D is left/right, space is jump, click is shoot, alt+enter for fullscreen.

Super Spineboy is a simple platformer where you shoot everything that moves. The game was used at the '14 A MAZE game festival in Berlin (here's the puppy and I) to show off Spine animations. It was written by myself and Shiu in ~3 days using libgdx and is open source on GitHub. It uses a loose MVC architecture for nice code organization. You can see the code here (start browsing at SuperSpineboy.java, then check out Model.java, View.java and the rest).

You can use the menu or number keys (1-6) to slow down time so you can better see the animations. Pressing Z will zoom in/out so you can see better. In particular, check out how landing from a jump transitions into running. Also, the Spineboy skeleton is manipulated to point the gun at the mouse and his torso, head and arms are adjusted so he leans forward/backward.

A good deal of effort was put into polish. For example, if you are running and jump a little late, after you fall off a ledge, it still jumps. If you hit jump a little too early before you land, it still jumps when you land. The camera has lookahead (only horizontal) for the direction you are looking, but this is reduced based on the distance to any enemies behind you (otherwise enemies behind you hit you before you get a chance to see them). There are lots of little things like this.

We didn't have a lot of time so the level is quite short and the difficulty ramps up quickly. The game does have an ending, so don't give up. Smiley These tips may help (spoiler alert! you may want to play first before reading these!):

  • Don't move through further into the level until you've killed all the enemies you find.
  • Spineboy's weapon shoots very fast, but suffers from reduced accuracy when shot continuously. Cease firing momentarily to regain accuracy.
  • You cannot shoot backward when running away, but you can jump while running away and shoot backward in the air.
  • Standing your ground and mowing down enemies is great, but there are quickly so many enemies that you get overrun. When this happens, goomba head stomp the enemies. This is key to winning!
  • Getting sandwiched between two groups of enemies is a sure way to die. Head stomp your way to one side so you aren't surrounded.
  • If the game runs poorly, try unchecking Background in the menu.

Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #1 - Posted 2014-05-09 11:58:36 »

I'm glad I didn't read all those tips before playing, because it was nice to find all of them out myself (except for that background one Wink it worked fine for me Smiley ).

The animations are beautiful, everything is smooth, spineboy looks fine, the gameplay is limited but perfectly okay. A score at the end of the level would make it much more appealing, though Wink

But I'm sure the most interesting about this project is the source code, so yeah ^^

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #2 - Posted 2014-05-09 17:56:54 »

Too bad we don't have a spoiler forum tag. Smiley I have stood next to 30-40 people playing the game. Most people totally suck at it and need the tips. In fact even with the tips most still suck, so I guess the game is a bit hardcore in its difficulty. Only one guy made it to the end (on his second try), but he was definitely an exception. In fact, I had intended Spineboy to have only 3 hitpoints, but I used 5 at the exhibition and then settled on 4 for the code on Github.

It was fun to write, a nice change of pace from working on Spine (for two years straight now!). I feel OK about the code, the MVC worked out pretty well. The model objects have a field for the view but it is never used in the model, it is just for convenience to avoid a model -> view object mapping. There are a few events that the model tells the controller about via a method. I figured proper events would be overkill. Reaction to the events could have gone in the view, but it was easier doing it there. The animations are kept in the view where they belong, the model just has states and times that the view uses to choose animations. I think this approach would scale pretty well for a more complicated game. Unlike an entity system, this loose MVC organization is pretty close to how I think people are used to coding and thinking, so should be a pretty easy style to adopt.

If anyone is curious about how the animations are done, you can grab the Spine projects here (alien and spineboy folders) or in this ZIP and open them with the Spine Trial. The alien has death, hit, jump and run animations. Spineboy has death, hit, jump, run, shoot and idle (and walk, but it isn't used in the game).


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #3 - Posted 2014-05-09 18:30:29 »

love the exploding alien brains, really nice touch Smiley
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #4 - Posted 2014-05-09 20:53:01 »

Thanks kappa! Smiley When the alien head explodes obviously the head and splatter changes images a few times, but notice Spine is used to scale, fade and translate the images.

I change the alien head to the first frame of the exploding head when they have one hit point left, and they behavior changes to be more aggressive. It wasn't planned to use the first frame like that, but it looked cool.  Cool

Offline ctomni231

JGO Wizard


Medals: 98
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #5 - Posted 2014-05-09 20:54:52 »

It is funny how well polish goes over your head when it is very well done, but in this case, I really enjoyed this very simple display of Spine. I did beat the game, but it didn't take me two tries... more like 5 Grin

Offline Mr.CodeIt

Junior Member





« Reply #6 - Posted 2014-05-10 05:27:07 »

Great animation and artwork, I still couldn't get too far ha. I found a bug in the left bound when you first spawn. I kept jumping and got stuck in the wall for a bit.

I'm not drunk, I've just been up late coding.
Offline atombrot

Senior Member


Medals: 9
Projects: 1



« Reply #7 - Posted 2014-05-12 19:04:42 »

Nice...

If you maximize the window (not fullscreen with alt+enter), the mouse aiming won't work correctly...
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #8 - Posted 2014-05-12 19:08:11 »

Mr.CodeIt, yeah I haven't bothered to fix that bug. Smiley

atombrot, strange, it works for me no matter what the window size is. Maybe you are just seeing the recoil? There is quite a lot of recoil, to give you a reason not to shoot (otherwise why even have a shoot button and shoot all the time? Smiley).

Offline atombrot

Senior Member


Medals: 9
Projects: 1



« Reply #9 - Posted 2014-05-12 22:05:15 »

Oh sorry, you are right. I see it now. I think I have started to shoot and then pointed down in all my maximized windows test. False alarm Wink
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline svinjo

Innocent Bystander





« Reply #10 - Posted 2014-05-15 04:20:13 »

It looks and works great, thanks for the source!
Animations are very nice, but the Spineboy looks aliased, especially on smaller sizes.
Is it possible to avoid that?
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #11 - Posted 2014-05-15 09:41:55 »

Thanks. Smiley Spineboy looks aliased in the screenshots and when the window is sized smaller because the source graphics are pretty high resolution. It should look nice maximized or full screen (alt+enter or use the menu):



You can see how the skeleton size is computed here:
https://github.com/EsotericSoftware/spine-superspineboy/blob/master/src/com/esotericsoftware/spine/superspineboy/Assets.java#L93
This sets the scale of the skeleton data loaded from JSON to "Player.height / Player.heightSource". Player.height is the height you want the player in game units. Player.heightSource is the height the player was in Spine in pixels. So if you want the player 10 game units tall and it was 200 pixels tall in Spine, you'd use a scale of 10/200=0.05.

That is how you would scale the skeleton data to whatever you use for units in your game. Eg, with Box2D you may be using meters instead of pixels. However, the same technique can be used to scale the skeleton data to match a texture atlas of a different size. When you pack your texture atlas, you might scale it up or down. Spine can pack an atlas using a scale, so can Texture Packer Pro, etc. You probably want to pack 2-3 atlases at different sizes to target a few resolutions. At runtime you choose the best atlas for the resolution and set the scale accordingly. Eg, if you pick an atlas that is 33% the size of the art used in Spine, you would use "json.setScale(0.33f)". Of course you can combine this with a scale for your game units, "json.setScale(Player.height / Player.heightSource * 0.33f);".

Offline imagnity

Junior Member


Medals: 2
Projects: 1
Exp: 11 years


Coding = Life;


« Reply #12 - Posted 2014-06-06 15:37:48 »

I didn't read any tips and died twice..finally I found that floating platform. Stand on it and shoot until they are all dead as red wedding! Enjoyed!  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!