jasonlooked #1
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "jasonlooked"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace the ad-hoc StoneState | {...} union in drawStone/draw with a named DrawableStone type. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>zoom out a bit so you can see the sidelines. the backline of the house only needs to be visible just above the controls
@ -24,7 +24,13 @@ pub struct Game {stones_red: u8,don't specify stone color here, just team1 or team2, allow generalizability to choose colors. for now we will default to red and yellow
instead of a score. call it scoreboard. for each end, specify team with hammer, score for team1, score for team2. show this scoreboard on the frontend. this allows the hammer and turn_team variables to go away.
@ -42,43 +48,31 @@ impl Game {stones_red: STONES_PER_TEAM,on the frontend, use a skeumorphic HUD to display how many stones are left. for instance, at the start of the game, show 2 rows of 8 stones. a stone should be removed from the hud when it is thrown.
@ -109,4 +97,1 @@}}pub fn can_start(&self) -> bool {the game should be playable with a single player who has the capability to switch teams
@ -183,4 +189,1 @@self.score_end_internal(true);}fn score_end_internal(&mut self, force: bool) {at the completion of an end, show a modal with the points scored, who has hammer next, and the updated scoreboard
@ -112,1 +110,3 @@}if try_join_room(&room).await.is_err() {let err = serde_json::to_string(&ServerMessage::Error {message: "Room is full".to_string(),remove this, there should not be a way to have a full room. all anyone to join and choose a team. teams may have multiple clients
@ -188,0 +221,4 @@.process_throw(&player_id, broom_x, broom_y, weight, curl, friction){Ok(ThrowOutcome {trajectory,this should be called trajectories since there are multiple stones moving
@ -188,0 +222,4 @@{Ok(ThrowOutcome {trajectory,end_scored,instead of saying end_scored, send the scoreboard which should include this information
@ -133,3 +132,4 @@activeStonePos: DrawableStone | null}) => {ctx.clearRect(0, 0, window.innerWidth, window.innerHeight)draw stones animations all at the same time. not one animation after another.
active stones don't need to be distinct from inactive stones. they can be all be active unless they go out of bounds
zoom out a bit so you can see the sidelines. the backline of the house only needs to be visible just above the controls.
FEET_TO_METERS = 0.3048
make the distances which are represented as feet as FOUR_FT_RADIUS = 2 * FEET_TO_METERS
@ -29,3 +35,4 @@export interface ClientThrowMessage {type: 'throw'broom_x: numberstone trajectory data structucture should be called trajectories with shape something like {stones: [{stoneid, rotation, team, trajectory:[x,y,theta]}])
same on the backend
@ -17,3 +5,4 @@import { GameModel } from './game-model'export function startGame(): void {const app = document.querySelector<HTMLDivElement>('#app')!move physics parameters (friction, curl) to a dropdown menu
the broom does not need to be constrained to the house. simplify this
@ -259,2 +172,2 @@if (gameState.myTeam !== gameState.turnTeam || gameState.animating || gameState.phase !== 'playing') returnsendThrow(broom.x, broom.y, velocity.getWeight(), curls.getSelected(), friction.getFriction())if (!model.isMyTurn) returnsendThrow(model.broom.x, model.broom.y, velocity.getWeight(), curls.getSelected(), friction.getFriction())physics parameters (curl, friction). should be a shared game state.
@ -0,0 +72,4 @@}tick(now: number): DrawableStone | null {if (!this.state.animating || this.activePath.length <= 1) {again, all stones should be animating at the synced time step
@ -0,0 +99,4 @@const y = p0[1] + (p1[1] - p0[1]) * tconst dx = t2[0] - t0[0]const dy = t2[1] - t0[1]const rotation = Math.atan2(dy, dx) * 2the rotation (theta) should come from the physics engine
physics comments:
set stone ids as (team, stone_number)
the back and sidelines should not be colliders because stones are out as soon as they touch those boundaries
stop scaling the weight, just use initial velocity (keep the test that determines the velocity to reach the hogline)
handle angular velocity in the physics engine. it should be linearly damped proportional to speed (lower speed, more friction). the starting angular velocity should be 5rot/14sec
a clockwise rotation should move right, the lateral velocity should be proportional to forward speed. (lower speed, more lateral velocity)
the friction setting should be a scalar multiplied by the following
interpolate the following for speed vs. friction
"speed (m/s)" "friction coefficient"
0 0.016
0.1482 0.014
0.3005 0.0116
0.4486 0.0098
0.7371 0.0079
1.0098 0.0073