19 lines
566 B
Lua
19 lines
566 B
Lua
this.on_init = function()
|
|
this.speed = 0.1
|
|
end
|
|
|
|
this.on_fixedupdate = function()
|
|
if Input.getKeyDown(Input.KeyCode.Up) then
|
|
this.position = this.position + Vec3:new(0, 1, 0) * this.speed
|
|
end
|
|
if Input.getKeyDown(Input.KeyCode.Down) then
|
|
this.position = this.position - Vec3:new(0, 1, 0) * this.speed
|
|
end
|
|
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
this.position = this.position + Vec3:new(1, 0, 0) * this.speed
|
|
end
|
|
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
this.position = this.position - Vec3:new(1, 0, 0) * this.speed
|
|
end
|
|
end
|