Skip to content

Physics.BallEntity

Matthew Daly edited this page Jan 3, 2023 · 5 revisions

Namespace: Verdant.Physics

class BallEntity

public class BallEntity : PhysicsEntity

An Entity with a Circle body.

Navigate

Constructors

public BallEntity

public BallEntity(RenderObject sprite, Vec2 position, float radius, float mass) : base(sprite, position, (int)(radius * 2), (int)(radius * 2), mass)

Initialize a new BallEntity.

Parameter Description
RenderObject sprite The Entity's sprite.
Vec2 position The position of the center of the Entity.
float radius The radius of the Entity's Ball. Also used to determine rendering width and height by default.
float mass The mass of the Entity's Body. 0 = infinite mass.

Methods

void SimpleInput

public void SimpleInput()

Move according to WASD input.

void Draw

public override void Draw(SpriteBatch spriteBatch)
Parameter Description
SpriteBatch spriteBatch
Clone this wiki locally