Jump to content

  • Log In with Google      Sign In   
  • Create Account


BUnzaga

Member Since 13 Aug 2006
Offline Last Active Sep 17 2013 02:09 PM
-----

Posts I've Made

In Topic: 'Fixed Timestep' wrap around problem

08 May 2013 - 07:40 AM

....teleport both the new position and the old one to the other side of the screen. In this way the ship seem to enter from the edge. Alternatively you can implement the wraparound logic after the interpolation step, i.e. storing an "absolute" ship position and then computing the modulus when computing the ship position on the screen

 

I currently have implemented the first suggestion, but would like more information on how I would go about doing your second suggestion properly. biggrin.png  I don't expect you guys to do the work for me, but just a keyword or two to look up in google would be highly appreciated.

 

So in my demo, I have 'previous', 'current', and 'rendered'(a better word would be interpolated).  In your second idea, I would use the interpolated position AFTER the physics calculation, not DURING it.  I like how that sounds.  Something like...

 

 

 while (accumulated >= TIC) {
  interpolated = oldPos = newPos
  newPos += TIC * Velocity
  accumulated -= TIC
 }
 ticLeft = accumulated / TIC

 smooth = 1.0 - ticLeft
 interpolated = (newPos * ticLeft) + (oldPos * smooth)
// handle the wrap around logic here?
// if interpolated > screen extents, set interpolated & oldPos & newPos to the teleported position?

In Topic: 'Fixed Timestep' wrap around problem

04 May 2013 - 09:08 PM

Hey thank you for the reply Paradigm Shifter.  Yes I wanted a similar effect, such as in Asteroids, only I don't need it to show the remaining ship as it wraps.  Just a simple...

 if > screen width, put back to 0.  The problem is that due to the interpolation, you can actually SEE the re-positioning, rather than it just appearing instantly on the other side.

 

In my fixed update, it just checks...

 

if arrowPos.x > screen width, set it to 0.  If arrowPos.x < 0 set it to screen width.

 

I am new to using an interpolation such as this, so I haven't had to deal with this sort of behavior before.

 

When the ship gets to the screen width, do I set ALL of them to 0?  Current Position, Previous Position, and Rendered(interpolated) Position?


In Topic: I want your opinions on Mobile controls and general game play.

02 February 2013 - 03:49 AM

Thank you for the feedback guys.

 

I did want to do something like a rogue-like, so I'll check it out for sure.


In Topic: Javascript - Better to instantiate variables, or leave them undefined?

15 October 2012 - 07:25 AM

Thanks slicer4ever, that is a good idea about setting them to null for error checking.

In Topic: How to manage input from more than one potential source?

07 October 2012 - 08:45 PM

slmgc, From what you are describing, it sounds like you are putting your actions into a queue or list of some sort, is that safe to assume? Then when you 'remove' or cancel the action, it removes only the one associated to that set or index.

It is an interesting approach, it sort of turns duplicate actions into unique actions via your indexing (set) system.

Thank you for sharing that with me.

PARTNERS