VoidShot/Scripts/NPC.lua
Hannah-Dagemark 520dddedf6 Changed locations, added Localization folder
Nothing except Title. Minor push, no update.
2023-09-05 15:15:24 +02:00

20 lines
No EOL
668 B
Lua

function wander(object, dt)
if object.x > object.attributes.wanderpoint + 2 or object.x < object.attributes.wanderpoint - 2 then
object.bools.isWalking = true
if object.x < object.attributes.wanderpoint then
object.physics.velocityX = 1
else
object.physics.velocityX = -1
end
else
object.attributes.wanderpoint = math.random(0, window.x)
end
end
function sayHello(object, dt)
object.attributes.time_spoken = object.attributes.time_spoken + dt
if object.attributes.time_spoken > 2 then
object.bools.isInteracting = false
object.attributes.time_spoken = 0
end
end