Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for i,key in ipairs({40,83}) do
- tfm.exec.bindKeyboard("Tectoon",key,true,true)
- end
- downx=0
- downy=0
- leftx=0
- lefty=0
- rightx=0
- righty=0
- upx=0
- upy=0
- bodyDef = {
- type = 0,
- width = 60,
- height = 10,
- foreground = false,
- friction = 0,
- restitution = 0.2,
- angle = 0,
- miceCollision = true,
- groundCollision = false,
- dynamic = false,
- fixedRotation = true,
- mass = 0,
- linearDamping = 0,
- angularDamping = 0
- }
- function eventKeyboard(name,key,down,x,y)
- -- cima e para baixo do solo
- tfm.exec.removePhysicObject(1)
- bodyDef.type=0
- bodyDef.width=60
- bodyDef.height=10
- bodyDef.miceCollision = true
- test = tfm.exec.addPhysicObject(1, x, y+20, bodyDef)
- downx=x
- downy=y+20
- tfm.exec.removePhysicObject(4)
- test = tfm.exec.addPhysicObject(4, x, y-30, bodyDef)
- upx=x
- upy=y-30
- -- chão esquerda e direita
- tfm.exec.removePhysicObject(2)
- bodyDef.type=0
- bodyDef.width=10
- bodyDef.height=60
- bodyDef.miceCollision = true
- test = tfm.exec.addPhysicObject(2, x-25, y-5, bodyDef)
- leftx=x-25
- lefty=y-5
- tfm.exec.removePhysicObject(3)
- test = tfm.exec.addPhysicObject(3, x+25, y-5, bodyDef)
- rightx=x+25
- righty=y-5
- end
- function eventEmotePlayed(playerName,emote)
- if emote==5 then
- -- cima e para baixo do solo
- tfm.exec.removePhysicObject(1)
- bodyDef.type=8
- bodyDef.width=60
- bodyDef.height=10
- bodyDef.miceCollision = false
- test = tfm.exec.addPhysicObject(1, downx, downy, bodyDef)
- tfm.exec.removePhysicObject(4)
- test = tfm.exec.addPhysicObject(4, upx, upy, bodyDef)
- -- chão esquerda e direita
- tfm.exec.removePhysicObject(2)
- bodyDef.type=8
- bodyDef.width=10
- bodyDef.height=60
- bodyDef.miceCollision = false
- test = tfm.exec.addPhysicObject(2, leftx, lefty, bodyDef)
- tfm.exec.removePhysicObject(3)
- test = tfm.exec.addPhysicObject(3, rightx, righty, bodyDef)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement