From 06bf8871a9654d0f1cbef43db57f67d62b8838c1 Mon Sep 17 00:00:00 2001 From: ghostlyzsh Date: Thu, 20 Apr 2023 21:05:18 -0500 Subject: [PATCH] fixed cargo bounding boxes and weights --- client/src/gateway.ts | 4 ++-- client/src/index.ts | 8 ++++---- server/src/timer.rs | 9 ++++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/client/src/gateway.ts b/client/src/gateway.ts index b44aded88d06c5fc010e502246dc97ff062561f7..94d37a0fae964c3c64ff0d06cbfd47f1d6c3dbb4 100644 --- a/client/src/gateway.ts +++ b/client/src/gateway.ts @@ -72,7 +72,7 @@ export async function gateway_connect(gateway_url: string, username: string): Ga let handshake_start_msg; if (global.can_beam_out) { handshake_start_msg = MessageC2SHello.encode({ - version: 2, + version: 3, requestedUsername: username, nextState: State.Play, user: window.localStorage.getItem("user")!, @@ -80,7 +80,7 @@ export async function gateway_connect(gateway_url: string, username: string): Ga }).finish(); } else { handshake_start_msg = MessageC2SHello.encode({ - version: 2, + version: 3, requestedUsername: username, nextState: State.Play, // @ts-ignore diff --git a/client/src/index.ts b/client/src/index.ts index 0b37dcdacec86dd8893d9f737f1ddcc7d7f0c24d..45be676a0d4d2e2a74b5c002df385034ccdd0bc2 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -218,17 +218,17 @@ async function client_main(server: string, username: string, texture_quality: st global.context.save(); - global.context.rotate(module.rotation); + global.context.translate(module.x - global.me!.x, module.y - global.me!.y); - global.context.translate(module.x, module.y); + global.context.rotate(module.rotation); global.context.drawImage(global.spritesheet_img!, tex.frame.x, tex.frame.y, tex.frame.w, tex.frame.h, - (module.x - 25 - global.me?.x!), - (module.y - 25 - global.me?.y!), 50, 50); + -25, + -25, 50, 50); global.context.restore(); } diff --git a/server/src/timer.rs b/server/src/timer.rs index ec3bbaefe3a7a7d5ad8704d816a2948b9ed84c93..bbdd4bb3b97d5a90af692279e07d093f1d0cd0ea 100644 --- a/server/src/timer.rs +++ b/server/src/timer.rs @@ -2,7 +2,7 @@ use std::{time::Duration, sync::Arc, f64::consts::PI}; use log::{debug, warn}; use nalgebra::{vector, point}; use rand::Rng; -use rapier2d_f64::prelude::{PhysicsPipeline, ColliderBuilder, RigidBodyBuilder}; +use rapier2d_f64::prelude::{PhysicsPipeline, ColliderBuilder, RigidBodyBuilder, MassProperties}; use async_std::sync::RwLock; use async_std::task::sleep; use starkingdoms_protocol::{player::Player, planet::PlanetType, module::ModuleType}; @@ -13,7 +13,7 @@ use crate::orbit::orbit::{calculate_point_on_orbit, calculate_world_position_of_ pub const ROTATIONAL_FORCE: f64 = 100.0; pub const LATERAL_FORCE: f64 = 100.0; -pub const MODULE_SPAWN: f64 = 1000.0; +pub const MODULE_SPAWN: f64 = 3000.0; pub const MODULE_MAX: u32 = 10; pub async fn timer_main(mgr: ClientManager, physics_data_orig: Arc>, entities: Arc>) { @@ -73,7 +73,10 @@ pub async fn timer_main(mgr: ClientManager, physics_data_orig: Arc() * PI * 2.