Skip to content

Commit

Permalink
update tick rate
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Aug 9, 2023
1 parent 42b26ae commit 7e9ccce
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>☔ rain.run</title>
<script type="module">import init from './satrunner-eca2b673e0131fc3.js';init('./satrunner-eca2b673e0131fc3_bg.wasm');</script>
<script type="module">import init from './satrunner-cf48e6b120c51744.js';init('./satrunner-cf48e6b120c51744_bg.wasm');</script>


<style>
Expand All @@ -17,8 +17,8 @@
}
</style>

<link rel="preload" href="./satrunner-eca2b673e0131fc3_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-eca2b673e0131fc3.js"></head>
<link rel="preload" href="./satrunner-cf48e6b120c51744_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-cf48e6b120c51744.js"></head>

<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ async function __wbg_init(input) {
if (wasm !== undefined) return wasm;

if (typeof input === 'undefined') {
input = new URL('satrunner-eca2b673e0131fc3_bg.wasm', import.meta.url);
input = new URL('satrunner-cf48e6b120c51744_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion src/game_core/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn handle_server(
if game_update.tick_adjustment > 0 {
client_tick.pause = game_update.tick_adjustment - 4;
player.adjust_iter = game_update.adjustment_iteration;
// if we are behind the server, then apply the new adjustment iteration. we know its a new iter if the number is higher than the one we have saved.
// if we are behind the server, then apply the new adjustment iteration. we know its a new iter if the number is higher than the one we have saved.
} else if game_update.tick_adjustment < 0
&& player.adjust_iter < game_update.adjustment_iteration
{
Expand Down
8 changes: 4 additions & 4 deletions src/game_core/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::player::{Enemy, Player};

pub const X_BOUNDS: f32 = 1000.0;
pub const Y_BOUNDS: f32 = 500.0;
pub const FALL_SPEED: f32 = 1.0;
pub const FALL_SPEED: f32 = 5.0;

#[derive(Debug)]
pub struct ObjectPos {
Expand Down Expand Up @@ -94,7 +94,7 @@ pub fn handle_bolt(

let y_position: f32 = Y_BOUNDS;
if client_tick.tick.unwrap_or(0) % 10 == 0 {
let pos_start = Vec3::new(x_position, y_position, 0.1);
let pos_start = Vec3::new(x_position, y_position, 0.0);
let new_pos = ObjectPos {
tick: client_tick.tick.unwrap(),
pos: pos_start,
Expand Down Expand Up @@ -154,7 +154,7 @@ pub fn handle_rain_behind(
let y_position: f32 = Y_BOUNDS;

if client_tick.tick.unwrap_or(0) % 10 != 0 {
let pos_start = Vec3::new(x_position, y_position, 0.1);
let pos_start = Vec3::new(x_position, y_position, 0.0);
let new_pos = ObjectPos {
tick: client_tick.tick.unwrap(),
pos: pos_start,
Expand Down Expand Up @@ -216,7 +216,7 @@ pub fn handle_bolt_behind(

let y_position: f32 = Y_BOUNDS;
if client_tick.tick.unwrap_or(0) % 10 == 0 {
let pos_start = Vec3::new(x_position, y_position, 0.1);
let pos_start = Vec3::new(x_position, y_position, 0.0);
let new_pos = ObjectPos {
tick: client_tick.tick.unwrap(),
pos: pos_start,
Expand Down
2 changes: 1 addition & 1 deletion src/game_core/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{game_util::resources::ClientTick, network::messages::PlayerInput};

use super::objects::{X_BOUNDS, Y_BOUNDS};

pub const PLAYER_SPEED: f32 = 2.0;
pub const PLAYER_SPEED: f32 = 10.0;

#[derive(Component)]
pub struct Player {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mod game_core;
mod game_util;
mod network;

pub const TICK_RATE: f32 = 1. / 30.;
pub const TICK_RATE: f32 = 1. / 10.;

fn main() {
App::new()
Expand Down

0 comments on commit 7e9ccce

Please sign in to comment.