Created
November 30, 2019 20:48
-
-
Save ryan-linehan/d517e8909d9dc83c9800d300cc356b11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Godot; | |
using System; | |
using SuperBrickBreaker.GameEnumerations; | |
public class Brick : RigidBody2D | |
{ | |
// Declare member variables here. Examples: | |
// private int a = 2; | |
// private string b = "text"; | |
// Called when the node enters the scene tree for the first time. | |
AnimatedSprite sprite; | |
Random rand; | |
BrickColor[] colors = { BrickColor.blue, BrickColor.brown, BrickColor.darkgreen, BrickColor.green, BrickColor.grey, | |
BrickColor.lightblue, BrickColor.orange, BrickColor.yellow, BrickColor.red, BrickColor.purple }; | |
public override void _Ready() | |
{ | |
rand = new Random(); | |
sprite = GetNode<AnimatedSprite>("AnimatedSprite"); | |
sprite.SetAnimation(rand.Next(0, colors.Length).ToString()); | |
} | |
// // Called every frame. 'delta' is the elapsed time since the previous frame. | |
// public override void _Process(float delta) | |
// { | |
// | |
// } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment