Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Text doesn't disappear?

I have been working on a script, and it displays text on the upper part of the screen.

I have a problem, the text is supposed to disappear over time... and it doesn't.

This is my update method(it's a window class)
[rgss] 
def update
  if @text != $text
    refresh
  end
  @wait -= 1
  if @wait < 1
    $text = ""
  end
  super
end
 
[/rgss]

what am i doing wrong?
 
What I notice is that your text won't disappear because @wait countdown keeps decreasing even if its assigned value is less than 0... Besides it also says...

Code:
if @text != $text

  refresh

end

Maybe it takes too long to make a new value assignment to $text and so it "never" changes...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top