I'm having a problem when trying to use " while " in the update method. Everytime I use while, the game goes not responding but it works just fine when trying to use " if ". The problem with " if " is that I can't hold the key I set for input.
Here's the script:
I would appreciate if someone could help me. Thanks in advance! 🙂
Here's the script:
class Goodish < Scene_MenuBase
def start
super
hoardyer
end
def update
super
while Input.trigger?🙂LEFT)
@dotty.x = @dotty.x - 5
end
end
def hoardyer
@background = Sprite.new
@dotty = Sprite.new
@background.bitmap = Cache.picture("Stany")
@dotty.bitmap = Cache.picture("Dot")
@dotty.x = 265
@dotty.y = 270
@background.opacity = 0
@dotty.opacity = 0
Graphics.wait(15)
Graphics.fadeout(2)
@background.opacity = 255
@dotty.opacity = 255
Graphics.fadein(2)
RPG::BGM.new("Battle4", 100, 100).play
end
end
def start
super
hoardyer
end
def update
super
while Input.trigger?🙂LEFT)
@dotty.x = @dotty.x - 5
end
end
def hoardyer
@background = Sprite.new
@dotty = Sprite.new
@background.bitmap = Cache.picture("Stany")
@dotty.bitmap = Cache.picture("Dot")
@dotty.x = 265
@dotty.y = 270
@background.opacity = 0
@dotty.opacity = 0
Graphics.wait(15)
Graphics.fadeout(2)
@background.opacity = 255
@dotty.opacity = 255
Graphics.fadein(2)
RPG::BGM.new("Battle4", 100, 100).play
end
end
I would appreciate if someone could help me. Thanks in advance! 🙂