So im just trying to do an applet, where this @ moves around, but when i press up it jumps. well it incremenets how its supposed to but does it so rapidly. If i slow the thread down, of course that slows the game engine down. I also noticed that if i hit up then down then up then down several times the gap between the two get bigger and bigger. Can anyone suggest anything, thanks

thanks for the peek, i tried the floats, it decreases the "jumps" but after the up and downs the gap still gets bigger. I think my algorithm is just wrong. even used --; and ++; which makes more sense to use. Its really weird that im getting this gap to happen.

Ok i've ran into a problem i think its either my buffering or my tile algorithm, if anyone could please take a look and help out that would be awesome.When i run it off my computer its fine, http://www.scottscreations.com/rpg/index.html run it in a browser off my server it lags like heck.

pretty basic, it has to render the tile though each update and that i think is what is causing it, its cool cause if i want to say make this platform here and make it this long it does it. But maybe i'm way off on the idea and there is a better way.

It's good that your movement is working out nicely, but there's another issue.The while loop you're using for updating graphics? Be rid of it.What you want to do is use a Timer ( javax.swing.Timer ) and have your updates contained within an ActionLIstener class.Like so :

Why you should do this : Timers can have multiple ActionListeners added to them and removed from them. This is especially important when you have multiple things to refresh that will act in different ways, such as NPCs moving around according to their surroundings or the player's position. You can also stop and start Timers, which is useful if you want to pause the game or only have some things being refreshed under certain conditions.Other points include that you can remove ActionListeners from a timer (IE - removing the ActionListener from the timer when a component is removed from the screen).

I tried timer before and I wouldn't recommend it. Sure the a Timer with a calling to repaint() is the easiest way to get started for a begginer but I found out it had some issue. For example, the Timer was always like 2 milliseconds off the speed I want him to be... (Sometime like 10 millisec for fast timer).

I tried timer before and I wouldn't recommend it. Sure the a Timer with a calling to repaint() is the easiest way to get started for a begginer but I found out it had some issue. For example, the Timer was always like 2 milliseconds off the speed I want him to be... (Sometime like 10 millisec for fast timer).

However, you can still add multiple ActionListeners to a timer. This is especially important when you have multiple objects in multiple classes all checking and reacting to certain conditions (Such as a ball changing direction when it touches a wall, or a turtle turning around when it approaches a cliff).

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org