Skip to content

Instantly share code, notes, and snippets.

@sirkitree
Created October 31, 2014 00:48
Show Gist options
  • Select an option

  • Save sirkitree/d666c192d0b068420652 to your computer and use it in GitHub Desktop.

Select an option

Save sirkitree/d666c192d0b068420652 to your computer and use it in GitHub Desktop.
log position in janus with a new text object
room.update = function(delta_time) {
global_update_val++;
global_time_passed += delta_time;
var secs_passed = global_time_passed * 0.001;
var sin_secs = Math.sin(secs_passed);
var sin_secs2 = Math.sin(secs_passed * 3.14159 * 2);
room.objects["new_text1"].text = "up/down = 1 & 7: " + (updown / 4);
room.objects["new_text1"].pos.y = 1.5 + 0.25*sin_secs;
room.objects["new_text2"].text = "left/right = 2 & 8: " + (leftright / 5);
room.objects["new_text2"].col = Vector(0,0,0.5 + 0.5 * sin_secs2);
room.objects["new_text2"].col = Vector(0,0,0.5 + 0.5 * sin_secs2);
room.objects["new_text4"].text = "player.cursor_pos: " + player.cursor_pos;
room.objects["new_text3"].text = "back/front = 3 & 9: " + (backfront / 5);
mouse_offset_x = -1 * ((mouse_origin_x - player.cursor_pos.x) * movement_factor);
mouse_offset_z = -1 * ((mouse_origin_z - player.cursor_pos.z) * movement_factor);
//leave vertical calculation to keypresses for now
//mouse_offset_y = (mouse_origin_y - player.cursor_pos.y) * movement_factor;
cubearrayUpdate(true, null);
}//end of function room.update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment