use constraints to make chasey chase; now it is not wiggly
This commit is contained in:
parent
f736f50870
commit
59738d0376
@ -1016,10 +1016,9 @@ mknew(chasey, function(ship)
|
||||
end)
|
||||
|
||||
function chasey:act()
|
||||
local dx = 0
|
||||
if (self.x < primary_ship.x) dx=self.thrust
|
||||
if (self.x > primary_ship.x) dx=-self.thrust
|
||||
return dx, 0, false, self.x - 16 < primary_ship.x and self.x + 16 > primary_ship.x
|
||||
self.xmin = max(primary_ship.x-8, 0)
|
||||
self.xmax = min(primary_ship.x + 8, 112 - 8*self.size)
|
||||
return 0, 0, false, self.x - 16 < primary_ship.x and self.x + 16 > primary_ship.x
|
||||
end
|
||||
|
||||
xl_chasey=chasey.new{
|
||||
|
Loading…
Reference in New Issue
Block a user