2 This is a template for livecoding.
4 It is required() by the main.lua.
6 One wants to code the global_update(), global_draw(), and global_collide() routines
7 Put any new variables after the "declare variables here" line
11 --Set the FPS here (game speed depends on this)
14 --declare variables here
16 red
.image
, red
.h
, red
.w
= get_image("images/red_rectangle.png")
17 red
.collide
= function(self
)
18 print(os
.time().." collision!")
22 blue
.image
, blue
.h
, blue
.w
= get_image("images/blue_rectangle.png")
25 blue
.angular_velocity
= 1
27 --set up the events here: evman variable
28 evman
.mouse
.motion
= function(x
,y
) red
.x
= x red
.y
= y
end
29 evman
.mouse
.pressed
[1] = function() red
.angular_velocity
= 1 end
30 evman
.mouse
.released
[1] = function() red
.angular_velocity
= 0 end
32 --updating stuff goes here
33 function global_update()
39 --drawing stuff goes here
40 function global_draw()
47 --collision stuff goes here
48 function global_collide()
49 check_collisions_obj_obj(red
, blue
)