The Daily Click ::. Forums ::. Klik Coding Help ::. Scrolling Probs
 

Post Reply  Post Oekaki 
 

Posted By Message

AMcDadle



Registered
  14/02/2011
Points
  3
20th February, 2011 at 22:25:20 -

A day ago i started working on an engine or "test level" for the game im starting to work on. I was going to make it an advanced scrolling mechanism. With the Actual Camera And the fake camera. I Set the fake cameras position on the player and i set the x postion to X( "Actual Camera" )+X( "Fake Camera" )-X( "Actual Camera" )*0.09

 
~Austin~
<br />

<br />
Pro Coder

AMcDadle



Registered
  14/02/2011
Points
  3
20th February, 2011 at 22:26:18 -

And when i start the application the Actual camera flys to the right not following the fake camera

 
~Austin~
<br />

<br />
Pro Coder

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
20th February, 2011 at 22:35:20 -

Looks like a job for Order of Operations Man!

Give this a go:

X( "Actual Camera" )+ ((X( "Fake Camera" )-X( "Actual Camera" ))*0.09)

Parentheses are lovely. Hope that's right.

What it's doing right now is first multiplying the current X position of the camera by a small number. We'll call that A. So it's doing: (Current Camera X) + (Fake Camera X) - (A, some tiny number). Putting in parentheses to force it to find the distance between the cameras first should make it work...

Edited by OMC

 

  		
  		

Hagar

Administrator
Old klik fart

Registered
  20/02/2002
Points
  1692

You've Been Circy'd!Teddy Bear
20th February, 2011 at 23:09:36 -

Always remember BODMAS.

Brackets Out Division Multiplication Addition Subtraction. I hope this applies to MMF too.

Always wondered in programming C etc what the precedence is for shifts is for example, hence I tend to go brackets crazy to ensure I get the answer I wish

Note here is the answer for C programming http://www.difranco.net/cop2220/op-prec.htm google is my friend

Edited by an Administrator

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
20th February, 2011 at 23:26:53 -

Or if you're from the US, Please Excuse My Dear Aunt Sally. (Parentheses, Exponents, Multiplication/Division, Addition/Subtraction)

 

  		
  		
   

Post Reply



 



Advertisement

Worth A Click