class RaylibPong::Paddle

Overview

A player controlled paddle.

Defined in:

raylib_pong.cr

Constant Summary

HEIGHT = 0.1

The relative height of the paddle

MARGIN = 0.1

How relative width the paddle should be from the edge of the screen

SPEED = 0.75

How fast the paddle can move

WIDTH = 0.01

The relative width of the paddle

Constructors

Instance Method Summary

Constructor Detail

def self.new(owner : RaylibPong::Paddle::Player) #

[View source]

Instance Method Detail

def abs_bounds #

The absolute bounding box of the paddle on the screen.


[View source]
def bounds #

The relative bounding box of the paddle.


[View source]
def draw #

Draws the paddle on the screen.


[View source]
def move(d : Direction) #

Move the paddle in a direction.


[View source]
def owner : Player #

What player owns this paddle.


[View source]
def position : Raylib::Vector2 #

The relative location of the paddle.


[View source]
def position=(position : Raylib::Vector2) #

The relative location of the paddle.


[View source]
def update #

Update the paddle.


[View source]
def wall_hit_check #

Checks if the paddle has hit a wall and confines it within the play area.


[View source]