Commit ab688d48 authored by Goerf's avatar Goerf

Upload New File

parent 632ef600
Obstacle = class('Obstacle')
function Obstacle:initialize(grid_x, grid_y, width) -- grid_x und y sowie width in Grid-Nr.-Position und nicht Pixel!
self.grid_x = grid_x
self.grid_y = grid_y
self.x = self.grid_x*grid_ppNo
self.y = self.grid_y*grid_ppNo
self.width = width*grid_ppNo
self.height = grid_ppNo
self.isborder = false -- wenn der flag gesetzt ist, vereinfache die Kollisionsabfrage
if(self.grid_x <= 0 or self.grid_x >= grid_no_longitude-1) then
self.isborder = true
if(self.grid_y <= 0 or self.grid_y >= grid_no_longitude-1) then
self.isborder = true
table.insert(list_obstacles, self)
function Obstacle:draw(),0.1,0.1)"fill", self.x, self.y, self.width, self.height),1,1)"/"..tostring(self.grid_y).."/w: "..self.width, self.x, self.y)
return Obstacle
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment