The Daily Click ::. Forums ::. Klik Coding Help ::. Scrolling problem in TGF
 

Post Reply  Post Oekaki 
 

Posted By Message

Trey



Registered
  30/07/2003
Points
  380
22nd November, 2004 at 17:25:18 -

http://www.goto-site.com/sforums/index.html

Here's the problem. I have the objects closer to the screen moving by faster thus creating a 3D effect.

But, I have a bug. As of now, I have the objects moving in relation to the "Repeat while joystick pressed" function. So, if you hold right the objects have their position set to -x,0 from themselves. and left is x,0. (x being the number of pixels.) But when you get to the left or right of the playfield, the screen no longer scrolls, but the objects are still moving. How can I stop them from moving when the screen isn't scrolling.

 
n/a

daveC04



Registered
  26/09/2004
Points
  163
22nd November, 2004 at 20:35:09 -

the file you linked to was pretty broken for me, but i think i know what your talking about.

on your repeat while pressing right line, add another condition saying that the players x position has to be less than a certian value. that value of course depends on the size of your playfeild. same thing for the left, except that it will only move things left if the players x position is greater than a certian x value. just mess with it a bit until it works nice.

i think that makes sense.

 
n/a

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
22nd November, 2004 at 21:45:33 -

But it would still scroll if the player tries to run against a wall. The download didn't work for me (you have to put all three installer files in the zip), but I'm assuming that you're using the default platform engine. A custom platform movement that restricts movement on collision (as opposed to literally moving the player back) would work well for that. If not, just implement some left/right detectors.

Always: position detectors (use fastloop here to prevent "lag")

Player moved right and right detector object is not overlapping an obstacle & right detector is not overlapping any active objects being used as obstacle (put them all in a group to save code): do parallax stuff, move player(if custom).

Player moved left and left detector object is not overlapping an obstacle & left detector is not overlapping any active objects being used as obstacle (put them all in a group to save code): do parallax stuff, move player(if custom).

 
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames
   

Post Reply



 



Advertisement

Worth A Click