13 December 2014

Developing Square Drop - Part 2

This week I have managed to make the square go through the gap on mouse click. This is what I've learned:
  • Replaced 3D blocks with sprites as it is a 2D game. It works much better and smoother now
  • Learnt to use OnTriggerEnter as opposed to OnCollisionEnter otherwise the square wouldnt go through the platform because it had physics attached to it
  • Learnt how to refer to a variable from another class
  • Learnt how to do OnMouseClick events
  • Made the square go through the gap on mouse click providing it touches the gap sprite but not the edge of the platform which I called sensors
This is the stage:

This is the game (the black square in the bottom right has the on click event which allows for the square to drop):

And this is my code of all the three classes I have so far:



No comments:

Post a Comment