• Register

A game design studio working on one design philosophy, make simple, mechanically fun games

RSS My Blogs

Block Stacker - Devlog #3 & New Gameplay Video

BoulignyGames Blog

Devlog #3

Added Sticky Boxes and Super Sticky Boxes, Bomb Boxes, Magnetic Push Boxes, Magnetic Pull Boxes, and WoLoLo Boxes.

Changed how scoring works so you gain score for each red knocked off during the game then the game does a final tally at the end of the blocks still in play.


New Gameplay Video

Block Stacker - Devlog #2

BoulignyGames Blog

09/03/18 NEW LEVEL AND BULLET TIME MECHANIC ADDED

User Posted Image

Hi everyone!Welcome to Bouligny Games first devlog.


ABOUT THE GAME

Its a game about stacking blocks. Stack as many blocks as you can as fast as you can in the 1 minute time attack mode or see how big you can build a stack in endless mode. Try out a few of the custom levels too!

STORY TIME: Originally the games that I've made haven't really made it to completion, but recently I decided to dive head first into development and really finishing something so I picked a small project and setup some media and decided to get something out there. I've decided to follow KISS for this first game and just release something that I think is fun and interesting. Enter...


BLOCK STACKER a unity game


Mechanics:

The games mechanics are simple. Left click to spawn a block. At an interval, the enemy will spawn a block. The entire game is a variation on have more blocks on the screen than the enemy. The twist is that the platforms the blocks will sit on are rotating at an interval. Try to push enemy blocks off while keeping your blocks on the platform!


Code

Fairly straight forward, the most interesting parts are the block spawn script to prevent spawning blocks inside other blocks, the rotating platform code, and the spawn area code.


Block Spawning:

So originally my code had the ability to spawn blocks inside of other blocks. And while this was really interesting to watch...
User Posted Image
It didnt make for such good gameplay. So I put a collider on an empty game object called Mouse Spawn Checker and a script called isObjectAtSpawn.

 public bool objectAlreadyAtSpawn = false; public float sideLengthOfCollider; BoxCollider checkerCollider;
 private void Start() { objectAlreadyAtSpawn = false; checkerCollider = GetComponent<BoxCollider>(); checkerCollider.size = new Vector3(sideLengthOfCollider, sideLengthOfCollider, sideLengthOfCollider); }
 private void OnTriggerEnter(Collider other) { if(other.CompareTag("PlayerObject") || other.CompareTag("EnemyObject")) { objectAlreadyAtSpawn = true; } }
 private void OnTriggerStay(Collider other) { if (other.CompareTag("PlayerObject") || other.CompareTag("EnemyObject")) { objectAlreadyAtSpawn = true; } }
 private void OnTriggerExit(Collider other) { if (other.CompareTag("PlayerObject") || other.CompareTag("EnemyObject")) { objectAlreadyAtSpawn = false; } }
 private void Update() { Vector3 pos = Input.mousePosition; pos.z = Camera.main.gameObject.transform.position.z;
 Vector3 spawnPos = Camera.main.ScreenToWorldPoint(pos);
 gameObject.transform.position = spawnPos; }


Simple code right? What it does is if the collider is triggered by any of the boxes it sends out false to the GameController script that runs the block spawning. If its false the player cant spawn. The collider stays at mouse position all the time.In the game controller there's an if statement for the conditions for spawning blocks, if its true the pointer is green else the pointer is red.
The best part about this code is the collider size. I can decrease or increase the collider size to allow the player to still spawn blocks between other blocks to you can sort of push blocks around in giant messy stacks. This was something I wanted to keep because it made the game more skillful and fun.
Rotating Platforms and Spawn Areas:So the platforms rotate on an interval. Pretty straight forward. What I made sure to do was to have a max rotation angle for the left and the right. This way you can make a platform rotate to only one direction or another. This means, coupled with an independent spawn zone, you can make make levels like pachinko machines.
This is not one of those machine. But it may be one soon!

User Posted Image


Plank Rotate Only

(There's a plank with a spawner on it but that code is just a combo of the two below)

using System.Collections;using System.Collections.Generic;using UnityEngine;
public class PlankRotateOnly : MonoBehaviour {
 [Header("Plank")] public GameObject plank;
 //Rotation Control [Header("Rotation Control")] //The plank where the player want to land the values //Basically how this works is how far to the left or right the plank can rotate to //The max rotation angle, this is the max angle that the plank can rotate to public float maxRightRotationAnglePlank; //The min rotation angle, this is the minimum angle the plank can rotate to public float maxLeftRotationAnglePlank; //How long before the plank picks a new rotation public int plankRotationDelay; //How fast the plank will move to the new rotation MAX public float maxRotationSpeedPlank; //the slowest the plank will move to its next rotation public float minRotationSpeedPlank; //I dont know what this does //public float rotationAdder; //The timer counting up to the next rotation float plankRotationTimer; //the next target rotation float plankRotationTarget; //the speed the plank will rotate to the next rotation float plankRotationSpeed; public GameController gameController;// Use this for initialization void Start () { plankRotationTimer = Time.time + plankRotationDelay; plank = gameObject; gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>(); }
 // Update is called once per frame void Update () { //Rotate platform //if the current global time is longer than the plank rotation timer its time to rotate again if (Time.time > plankRotationTimer && gameController.playingGame) { plankRotationTarget = Mathf.Round(Random.Range(-maxLeftRotationAnglePlank, maxRightRotationAnglePlank));
 //No idea what this does //plankRotationTarget += (Mathf.Sign(plankRotationTarget) * rotationAdder);
 plankRotationSpeed = Random.Range(minRotationSpeedPlank, maxRotationSpeedPlank); plankRotationTimer = Time.time + plankRotationDelay; }
 //create the new value and move towards it float angle = Mathf.MoveTowardsAngle(plank.transform.eulerAngles.z, plankRotationTarget, plankRotationSpeed * Time.deltaTime); //set the transform of the plank plank.transform.eulerAngles = new Vector3(0, 0, angle); //rotate platform ends }}


Enemy Spawn Area

using System.Collections;using System.Collections.Generic;using UnityEngine;
public class EnemySpawnArea : MonoBehaviour {
 [Header("Enemy Block Control")] //How long the delay between enemy placing blocks is public float delayBetweenSpawningEnemyBlocks; //The actual timer float enemyBlocksDelayTimer; //The box that will be spawned public GameObject enemyBox; //The game controller so we can get the list of current spawned blocks public GameController gameController;
 //User inputted ymin and ymax and zpos [Header("Height and Depth Cords")] public float minY; public float maxY; public float zPos;
 public float xLeftCord; public float xRightCord;
 public GameObject plank;
 // Use this for initialization void Start () { gameController = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameController>();
 if(plank != null) { xLeftCord = plank.transform.position.x - plank.transform.localScale.x / 2; xRightCord = plank.transform.position.x + plank.transform.localScale.x / 2; } } // Update is called once per frame void Update () { //Spawn enemy blocks if (Time.time > enemyBlocksDelayTimer && gameController.playingGame) { //Pick an x position based on the smallest and largest values float xSpawnVal = Mathf.Round(Random.Range(xLeftCord + .5f, xRightCord - .5f));
 //We pick a random height for the block to spawn in based on ymin and ymax float ySpawnVal = Random.Range(minY, maxY);
 //Send where the enemy box is spawned and correlate to where the player has blocks spawned
 //spawn the box based on the random values and a predetermined zposition Instantiate(enemyBox, new Vector3(xSpawnVal, ySpawnVal, zPos), Quaternion.identity);
 //increase the delay timer for the next spawned block enemyBlocksDelayTimer = Time.time + delayBetweenSpawningEnemyBlocks; } }}


Bullet Time:

I added a bullet time mechanic in devlog #2. This was mostly because I had a player who didnt do so well as a beginner at a high difficulty. Id like to give players who are just getting into a higher difficulty a way to play the game and learn at a slightly slower pace. I'm going to reward the player with extra score for not using bullet time.
Bullet time works by pressing spacebar and lowering a float value by time.unscaledDeltaTime. The only real changes is that every mechanic in the game works on normal time that is scaled with time.scale = .5 (half speed) and the bullet time timer and the cooldown for the player spawning blocks work with the unscaled time values.

DEVLOG VIDEOS

Devlog #1:

DevLog #2:

Full Release

COMING SOON!

I'm in the final stages assemblying levels, putting art into the game, and putting the final touches on the game modes.