Search Unity

Blast! - free game on Kongregate

Discussion in 'Made With Unity' started by Deleted User, Sep 13, 2012.

  1. Deleted User

    Deleted User

    Guest

    I launched a little game on Kongregate today called Blast!. Blast! is an arcade puzzle-shooter where you fire blocks into shapes in order to make them full rectangles. When you do that they explode and you get points. There is a bonus for larger rectangles so sometimes it's advantageous to add some unnecessary blocks to make the shape bigger. As you earn points the game speeds up so you have to start reacting quite fast in order to keep going.

    The game is inspired by an old classic Game Boy game I played as a kid called Quarth. Hardly anyone I know has heard of the game, let alone played it. I always liked the core idea and have wanted to build something like it for a while.

    Thanks to Unity I was able to whip this game together in probably about 15-20 hours over the weekend. It uses no plugins and actually is using cubes to represent all the objects in the game. I even rely on the physics engine for my collision tests.

    Anyway go check out Blast! and let me know what you think.
     

    Attached Files:

  2. Deleted User

    Deleted User

    Guest

    Loved the game, super simple and fun! Played it a few times through and got 200,000 highscore! Not even sure that is good. I am now inspired to make a game similar to this.

    You should now have a pm good sir.
     
  3. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    I was impressed and enjoyed the simple yet addictive gameplay provided by this retroesque shooter.

    How did you achieve the camera shake as I cant get mine to work.
     
  4. Deleted User

    Deleted User

    Guest

    Thanks! Glad you liked it. Quarth was always a great little Game Boy game. I love trying to see the patterns so in my head I play the game as a stream of keys: LEFT SPACE LEFT LEFT SPACE LEFT SPACE SPACE.

    I don't have the exact code on hand since I'm at work but this is basically it (written from memory so it might be a little off or have a bug; I can't test it):

    Code (csharp):
    1. using UnityEngine;
    2.  
    3. class Shake : MonoBehaviour
    4. {
    5.     private Vector3 _startPos;
    6.     private bool _isShaking;
    7.     private float _timer;
    8.     private float _duration;
    9.     private float _magnitude;
    10.  
    11.     public void Shake(float duration, float magnitude)
    12.     {
    13.         // we only store the start position if we're not shaking. this
    14.         // allows us to have other calls to shake and know that we'll
    15.         // always come back to the original starting position.
    16.         // without this, if you called Shake a bunch of times, you'd
    17.         // slowly drift away from where you started.
    18.         if (!_isShaking)
    19.         {
    20.             _startPos = transform.position;
    21.         }
    22.  
    23.         _isShaking = true;
    24.         _timer = _duration = duration;
    25.         _magnitude = magnitude;
    26.     }
    27.  
    28.     void Update()
    29.     {
    30.         if (_isShaking)
    31.         {
    32.             _timer -= Time.deltaTime;
    33.  
    34.             // clamp our t value in [0, 1] so we don't do anything weird with
    35.             // the magnitude (like go negative)
    36.             float t = Mathf.Clamp(_timer / _duration, 0, 1);
    37.  
    38.             // this scales magnitude linearly down to 0 over the duration
    39.             // of the shake since we start _timer at _duration and subtract
    40.             // down, t will start a 1 and move to 0 over the duration.
    41.             // this gives us a nice ramp down from the full shake so that when
    42.             // it stops it isn't super sudden for the viewer.
    43.             float realMag = _magnitude * t;
    44.  
    45.             // compute the offset based on the magnitude. if doing a full 3D
    46.             // camera you'll want to also randomly pick a Z value
    47.             Vector3 offset = new Vector3(
    48.                 Random.Range(-realMag, realMag),
    49.                 Random.Range(-realMag, realMag),
    50.                 0);
    51.  
    52.             // add the offset to our starting position and set that as our
    53.             // transform position
    54.             transform.position = _startPos + offset;
    55.  
    56.             // if we've run down our timer, stop shaking
    57.             if (_timer <= 0)
    58.             {
    59.                 _isShaking = false;
    60.             }
    61.         }
    62.     }
    63. }
    64.  
    I attach that to my Camera and then I can call the Shake method on it with whatever duration and magnitude I want. It does have a linear falloff so that the effective magnitude shrinks to 0 over time. I find this is nice as it doesn't give you jarring end to the shake.

    Hope that helps!
     
  5. Myaka

    Myaka

    Joined:
    Jul 7, 2012
    Posts:
    84
    Great concept nicely done!
    It gets really fun when you miss and you have to fix your error. Got 138 000 from the first run, going to try to get more!
     
  6. Myaka

    Myaka

    Joined:
    Jul 7, 2012
    Posts:
    84
    214 something
    Addictive as F***
     
  7. ncst

    ncst

    Joined:
    May 28, 2011
    Posts:
    207
    Nice game: My only suggestion is to allow the user to click options on the menu (instead of hitting enter).
     
  8. tatelax

    tatelax

    Joined:
    Feb 4, 2010
    Posts:
    1,168
    It's not what I expected. It's much better.
     
  9. Deleted User

    Deleted User

    Guest

    Thanks! I really enjoy making simple games that are really fun.
     
  10. _Shockwave

    _Shockwave

    Joined:
    Sep 2, 2012
    Posts:
    21
    omg dude this is freaking epic!
    I love the explosion effect, shake of camera, you should port it to tablet/phones!!!!
     
  11. softwizz

    softwizz

    Joined:
    Mar 12, 2011
    Posts:
    793
    Thanks for the camera shake script, works great and I had no problems using it.
     
  12. Deleted User

    Deleted User

    Guest

    Thanks, I worked hard to make the explosions and camera shake feel good.

    I'm currently experimenting with porting to mobile. The game relies on a very quick binary motion for left/right so there are some subtleties to making it play nicely on those platforms. However my quick and dirty prototype port got me playing for a while today, so it definitely is something I hope to do.