Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Up = 0
- Down = 1
- Left = 0
- Right = 0
- Moving = 1 -- IMPORTANT! If It Sets To 0. You Cannot Move!
- b = CreateSprite("Fake_Overworld/back")
- b.layer = "Top"
- b.x = 320
- b.y = 230
- bg = CreateSprite("Fake_Overworld/hotlands_1")
- bg.layer = "Top"
- bg.x = 320
- bg.y = 230
- savepoint = CreateSprite("Fake_Overworld/spr_savepoint_0")
- savepoint.layer = "Top"
- savepoint.x = 320
- savepoint.y = 230
- frisk = CreateSprite("Fake_Overworld/Frisk/f_0")
- frisk.layer = "Top"
- frisk.x = 300
- frisk.y = 200
- Player.SetControlOverride(true)
- savepoint.SetAnimation({"Fake_Overworld/spr_savepoint_0", "Fake_Overworld/spr_savepoint_1"}, 1/2)
- function Update()
- if Input.Up > 1 and Moving == 1 then
- frisk.y = frisk.y + 2
- Up = Up + 1
- Down = 0
- Left = 0
- Right = 0
- end
- if Input.Down > 1 and Moving == 1 then
- frisk.y = frisk.y - 2
- Down = Down + 1
- Up = 0
- Left = 0
- Right = 0
- end
- if Input.Left > 1 and Moving == 1 then
- frisk.x = frisk.x - 2
- Left = Left + 1
- Up = 0
- Down = 0
- Right = 0
- end
- if Input.Right > 1 and Moving == 1 then
- frisk.x = frisk.x + 2
- Right = Right + 1
- Up = 0
- Down = 0
- Left = 0
- end
- if Down > 2 and Down < 8 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/f_0"})
- elseif Down > 9 and Down < 17 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/f_1"})
- elseif Down > 18 and Down < 26 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/f_2"})
- elseif Down > 27 and Down < 35 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/f_3"})
- elseif Down > 36 then
- Down = 1
- end
- if Up > 2 and Up < 8 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/b_0"})
- elseif Up > 9 and Up < 17 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/b_1"})
- elseif Up > 18 and Up < 26 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/b_2"})
- elseif Up > 27 and Up < 35 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/b_3"})
- elseif Up > 36 then
- Up = 1
- end
- if Left > 2 and Left < 8 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/l_0"})
- elseif Left > 9 and Left < 17 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/l_1"})
- elseif Left > 36 then
- Left = 1
- end
- if Right > 2 and Right < 8 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/r_0"})
- elseif Right > 9 and Right < 17 then
- frisk.SetAnimation({"Fake_Overworld/Frisk/r_1"})
- elseif Right > 36 then
- Right = 1
- end
- if Right == 0 and Left == 0 and Down == 0 and Up == 0 then
- error("Oops! You Did Not Choose Your Direction!")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement