I'm working on a new platform engine focusing on speed. The player can move anywhere from 6 to 15 pixels per TGF event loop (3 + 3 * Speed), with all collision detection and movement done in fastloops. I am currently using the following scrolling method:
Always set Y position of "Scroller" to Y position of "Player"; If player is facing right + scroller's X position < Player's X position + 100, add 6 to scroller's x position; If player is facing left + scroller's X position > Player's X position - 100, subtract 6 from scroller's x position.
The player sprite (actually made up of 5 diff active objects) shimmers like crazy when the screen scrolls, but it's fine when it moves without scrolling. How can I fix this?
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
If you use always conditions to set the body parts together, you might want to change it so that you set the positions on the fastloop, otherwise the objects will drift apart slightly
If it's just one piece shimmering, try positioning the pieces from a central something.(invisible block?)
Then they might all shimmer at once, hiding the shimmering....but if not, maybe one of the scrolling methods from my Scrolling Methods download could help?
No, I move all pieces at once in the fastloops. The arms and feet move when walking, but keep the same relative positions when jumping. By shimmer, I mean the active objects flicker; they appear to move back and forth fast enough to make both "instances" semitransparent. Just the hands seem to flicker at low speeds, but all the character's active objects flicker at once at higher speeds. This flickering only happens when the frame scrolls. I tried the platform scroll (look further in the direction you're facing), a simple center at (0,0) from the torso, and a platform scroll where the scrolling object is moved in the x movement fastloop, the screen is centered, and the frame redrawn, but it still shimmers.
Edited by the Author.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
Oops. I just realized that it only flickered when walking, not when jumping (the same loops handle horizontal movement for both.) I looked through my code, and, sure enough, for some idiotic reason I told TGF to only move the parts if the character WASN'T walking. D'oh. It works now...except for slopes. Thanks for your help.
Edited by the Author.
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames