1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
CrystalPlayer = Fill:extend{
fill = {255,0,0},
height = 32,
width = 32,
onStartFrame = function(self)
if the.mouse:pressed() then
print('hi')
end
--local dx = the.mouse.x - 400
--local dy = the.mouse.y - 300
local dx = love.mouse.getX() - 400
local dy = love.mouse.getY() - 300
self.acceleration.x = dx * 10
self.acceleration.y = dy * 10
--print(dx, dy)
-- NOTE: actually, maybe I want to show the mouse?
love.mouse.setPosition(400,300)
end
}
SpacePlayer = Fill:extend{
fill = {255,0,0},
height = 32,
width = 32,
onStartFrame = function(self)
--local dx = love.mouse.getX() - self.x
--local dy = love.mouse.getY() - self.y
local dx = love.mouse.getX() - 400
local dy = love.mouse.getY() - 300
self.acceleration.x = dx * 2
self.acceleration.y = dy * 2
end
}
|