public bool AssignToGrid(Shape s) { if (this[s.position] == null) { this[s.position] = s; return true; } else return false; }
public virtual bool CollisionCheck(Shape other) { return Vector2.Distance(other.position, position) <= RADIUS * 2; }
protected Sprite GenerateSprite(Shape s) { return new Sprite(textures[s.GetType()], FieldToScreen(s.position), PolarityColor(s.polarity), -s.Direction, new Vector2(RAD, RAD), (float)Shape.RADIUS / RAD, 0F); }
private void Spawn(Shape s) { if (!AssignToGrid(s)) return; //square was occupied if (s is Player) { if (player == null) player = (Player)s; //we can't add a second player else this[s.position] = null; } else enemies.Add(s); }