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.

Window_Base+ movement methods [All Bugs Fixed]

Okay... I had another question too, but now I've fixed everything! (I think...) You can ignore this topic now, everything I've just posted is fixed :thumb:
 

khmp

Sponsor

I think your problem might be this. Let's say I have a @window at (9, 14), and I would like to move it to (0, 0) at a speed of 2 pixels per frame.
Code:
@window.x_move_to(0, 2)
@window.y_move_to(0, 2)

So the first time the update and move occurs the window's position should be (7, 13) then (5, 11), (3, 9), (1, 7), (-1, 5). On no. Now here's where the jitterbug begins. The window will continually correct itself because it can't reach 0 on the x or the y. The window will flip between, (-1, -1) and (1, 1). Thus the dance. You need to institute some corrective checking or toggle some kind of boolean to disable the move_to's from being called.

Good luck with it Kain Nobel! :thumb:
 
Cool, I've redefined the way it updates, it works better now, except one last problem. First, here's the updated scripts...

Code:
Code:

Okay, this last one is a merely small but irritating bug. Everything works fine, but when I go to move the windows outside of the top/left sides of the screen, they seem to hang on the side/top of the screen still. I've even tried x_move_to(-1000) just to make sure that the window fully hides itself, but it still gets stuck on the same spot.

Anybody have a remedy for that?
 

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