Tuesday, June 10, 2014

Simple Platformer Day 06

Day 6:
With Herbie's help, figured out how to destroy flowers using both trigger and collision.

Trigger:
check "is trigger" box in unity

void OnTriggerEnter2D() { Destroy (this.gameObject);}

Collision:
uncheck the trigger box in unity

void OnCollisionEnter2D (Collsion2D col) {}
(also accidentally killed player by using Destroy (col.gameObject);  need to learn parameters correctly.)

Lunch plans:

Do the score thing, including UI.

Tomorrow+'s plan:

  • Make kill floor.
  • Make player death function that calls a reset button.
  • Spawn an enemy that walks around the right platform.
  • Make sure flowers do not collide with enemy (likely adding if tag to the collision function)
  • Allow player to kill enemy by jumping on it.
  • Trigger player death if player collides with enemy.

No comments:

Post a Comment