astertris / classes / board.lua

--- board
require "lib/SECS"

board = class:new()

function board:init(pLevel,pWorld)
  self.x=200
  self.y=0
  self.w=400
  self.h=500
  self.border=50
  self.body_left=love.physics.newBody(pWorld, self.x-(self.border)/2, self.y+self.h/2, 0, 0)
  self.shape_left=love.physics.newRectangleShape( self.body_left, 0, 0,self.border,self.h,0)
  self.body_right=love.physics.newBody(pWorld, self.x+self.w+self.border/2, self.y+self.h/2, 0, 0)
  self.shape_right=love.physics.newRectangleShape( self.body_right, 0, 0 , self.border,self.h , 0)
  self.body_bot=love.physics.newBody(pWorld, self.x+self.w/2, self.y+self.h+self.border/2, 0, 0)
  self.shape_bot=love.physics.newRectangleShape( self.body_bot, 0, 0,self.w+self.border*2,self.border,0)
end

function board:update(dt)
end

function board:draw()
  love.graphics.setColor(255, 255, 255, 255)
  love.graphics.rectangle('line', self.x-self.border,self.y,self.border,self.h)
  love.graphics.rectangle('line', self.x-self.border,self.y+self.h,self.w+self.border*2,self.border)
  love.graphics.rectangle('line', self.x+self.w,self.y,self.border,self.h)
end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.