public void update(double dt) { if (editing) { editor.update(dt); } else { ui.update(dt); double desired = getCameraDesired(); if (x > desired) { double fgScroll = Math.Min(dt * 300, x - desired); for (int i = 0; i < parallax.Count; i++) { parallax[i] -= fgScroll * scrollValues[i]; } } else if (x < desired) { double fgScroll = Math.Min(dt * 300, desired - x); for (int i = 0; i < parallax.Count; i++) { parallax[i] += fgScroll * scrollValues[i]; } } bindParallax(); } }
public void update(double dt) { if (editing) { editor.update(dt); } else { ui.update(dt); } }
public void update(double dt) { if (!editing) { ui.update(dt); entities.ForEach((entity) => { entity.update(dt); }); camera.update(dt); if (scripts.Count > 0) { scripts.Peek().update(dt); if (scripts.Peek().finished) { scripts.Dequeue(); } } } else { editor.update(dt); } // sort entities (for perspective) for (int i = 1; i < entities.Count; i++) { Entity key = entities[i]; int j = i - 1; while (j >= 0 && entities[j].getLocation().Y > key.getLocation().Y) { entities[j + 1] = entities[j]; j = j - 1; } entities[j + 1] = key; } }
public void update(double dt) { ui.update(dt); map.x = getCameraPosition(map.width); }
public void update(double dt) { camera.update(dt); cursor.update(dt); ui.update(dt); }
public void update(double dt) { ui.update(dt); }