Skip to content

Create Block Interface #16

@alienboy13

Description

@alienboy13
  • Create a Block Game Object with a Block Script
  • Inside the Block Script, assign an array of sprites named damageLevels
  • Inside the Block Script, assign an integer called health
  • Inside the Block Script, Serialize and assign a BoxCollider2DCollider and a Rigidbody 2D component, add these to the game object
  • Create and Serialize a Variable for a GameSceneController Script
  • Create an OnCollisionEnter2D Methond
  • Check in that OnCollisionEnter2D Method for a Ball Script on the object which collided with it.
  • In the event of a collision, subtract health by 1, call a scoreIncrement Method on the GameSceneController Script, and check if health = 0. If it does, destroy the object. If not, move the sprite on the sprite renderer to the sprite at the (health-1) position of the damageSpritesList.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions