Page 1 of 1

"Juice It or Lose It" in LÖVE

Posted: Wed Apr 16, 2014 10:06 pm
by jimmytheleaf
Hello, this is my first post! I wanted to share something I did in case folks find it useful.

Late last year, inspired by Martin Jonasson & Petri Purho's "Juice It Or Lose It" video, I put together a LÖVE version of the "Juicy Breakout" game they originally did in Flash.

A good deal of coding, and three or four rounds of full refactoring later, I came up with an implementation that I’m moderately happy with. It can be found on github here.

Image

Features implemented include:

Specific Juicy Features
  • Splash Screen that bounces in
  • Bricks and Paddle that drop in, with jitter and elastic shape/rotation scaling
  • Bricks that flash colors, and rotate/scale-down/get launched off into background in the direction the ball hits them
  • Ball that has elastic shape scaling, color-change, and rotation on collisions
  • Paddle and Walls that elastically bounce when hit by ball
  • Background that flashes colors on certain ball collision events
  • Confetti particles that eject from ball upon collisions
  • Flashing “You Win” text when all bricks are destroyed
Support code to get us there:
  • A backend Entity-Component system for managing entities, along with basic CNF-query class for retrieving entities with particular components
  • Basic movement, input, collision, time, state, statistics-tracking, and rendering components / systems
  • Behavior system for adding special frame-by-frame logic to entities
  • Message system for announcing events and allowing entities to register their own response to events
  • Emitter component / system (used stupidly for particles here, but generic for any kind of entity)
  • Camera system (doesn’t get much advanced use here)
  • Tweening and Scheduling systems
  • Lua ports of a few basic Java-like collections classes
  • Implementation of a Pool util class
What I used / was influenced by:

Over the course of development, I refactored the codebase I was working on a few times to continually clean things up. Eventually I settled on creating a basic Entity-Component framework inspired by Artemis and posts by Adam Martin. Just about everything in the game is an Entity; every data attribute is packaged in a Component; and everything that happens to update or react to those Components happens in a System. For a basic overview of the theory behind this, check out this post.

When coming up with my own scheduler / tween systems, I was heavily influenced by code in VRLD's HUMP libraries. Other specific code I directly used can be found on the github page.


If you like what's there, I have more LÖVE experiments in my main love repository on github.

Re: "Juice It or Lose It" in LÖVE

Posted: Thu Apr 17, 2014 5:31 am
by Germanunkol
Oh my gosh, it's just as disco-y as the original!

Good work. I really appreciated some of their ideas, but all of the effects put together at once always seemed way too much to me. But it's a nice implementation!

Which reminds me. I still have to juice up the UI for our game...

Re: "Juice It or Lose It" in LÖVE

Posted: Fri Apr 18, 2014 7:25 am
by TheScriptan
I like how you made this game like faster and more lively. It doesn't look like just a casual game for me at least. :D
Anyways I found few bugs here. First one is if you press escape a lot it crashes the game and second one maybe it's not a bug it just needs the implementation I think. Now you can press space whenever you want, you should make it, when ball is out of the game and you should make a random direction for that ball, because he always flies into the same direction! :) Still game looks awesome and that splash screen tho'!