3×3 Version 7

Finally I’ve had some time to work on the 3×3 project, which have resulted in a version 7.

3x3 version 7
3×3 version 7

I’ve added a particle effect with box meshes, for when boxes are removed. I’m using the color of the removed box to fake the box exploding/being torn apart.
I had some difficulty getting the particle effect to use color over lifetime after switching to box mesh. So I ended up making a small fadeout script.

    public float alphaStart = 1.0f;
    public float alphaEnd = 0.0f;
    public float overTime = 1.0f;
    private float alpha;
    private float deltaAlpha;

	// Use this for initialization
	void Start () {
          alpha = alphaStart;
          deltaAlpha = (alphaEnd - alphaStart) / overTime;
	}

	// Update is called once per frame
	void Update () {
          alpha += deltaAlpha*Time.deltaTime;
          Color c = transform.renderer.material.color;
          c.a = alpha;
          transform.renderer.material.color = c;
	}

It’s linear, which I didn’t really want, but for now its ok. I plan to make it a bit more controllable. Something like time to wait before starting to fade out.

By pure accident I discovered that I hadn’t used Time.deltaTime anywhere, so I have corrected this, and tested and set new speed values in all scripts, moving, rotating or scaling objects over time.

After playing the game a few times I noticed that I wasn’t getting any points after level 8. This small bug was of cause, also fixed.

I plan to add some more sound effects and get some basic menus set up over the next few days, but I ‘ll have to see what time and motivation life brings. 🙂

Play version 7 and remember to give feedback. Thanks 🙂

– Henning

 

Leave a Reply

Your email address will not be published. Required fields are marked *