aboutsummaryrefslogtreecommitdiffstats
path: root/object.moon
blob: 18b546f8654cbdf764bae633269a0ba80074b5ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import vec2 from require 'cpml'
-- import random, hit, draw from require 'api'

class Object
  new: (@pos=random.point!, @size=random.size!) =>

  copy: => Object @pos, @size

  minmax: =>
    @pos - @size/2, @pos + @size/2

  hit: =>
    hit.rect @minmax!

  draw: =>
    draw.rect @minmax!

{
  :Object
}