feat(jump-hop): redesign sling platform gameplay

This commit is contained in:
2026-06-03 22:21:00 +08:00
parent 40ef89aeb5
commit 7d2d67a3f5
59 changed files with 6930 additions and 1973 deletions

View File

@@ -94,3 +94,19 @@ pub struct JumpHopEventRow {
pub(crate) result: String,
pub(crate) occurred_at: Timestamp,
}
#[spacetimedb::table(
accessor = jump_hop_leaderboard_entry,
index(accessor = by_jump_hop_leaderboard_profile_id, btree(columns = [profile_id])),
index(accessor = by_jump_hop_leaderboard_player_profile, btree(columns = [player_id, profile_id]))
)]
pub struct JumpHopLeaderboardEntryRow {
#[primary_key]
pub(crate) entry_id: String,
pub(crate) profile_id: String,
pub(crate) player_id: String,
pub(crate) successful_jump_count: u32,
pub(crate) duration_ms: u64,
pub(crate) run_id: String,
pub(crate) updated_at: Timestamp,
}

View File

@@ -14,6 +14,8 @@ pub const JUMP_HOP_GENERATION_READY: &str = "ready";
pub const JUMP_HOP_EVENT_RUN_STARTED: &str = "run-started";
pub const JUMP_HOP_EVENT_RUN_RESTARTED: &str = "run-restarted";
pub const JUMP_HOP_EVENT_JUMP: &str = "jump";
pub const JUMP_HOP_RUNTIME_MODE_DRAFT: &str = "draft";
pub const JUMP_HOP_RUNTIME_MODE_PUBLISHED: &str = "published";
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct JumpHopAgentSessionCreateInput {
@@ -96,6 +98,7 @@ pub struct JumpHopRunStartInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub runtime_mode: String,
pub client_event_id: String,
pub started_at_ms: i64,
}
@@ -106,11 +109,13 @@ pub struct JumpHopRunGetInput {
pub owner_user_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct JumpHopRunJumpInput {
pub run_id: String,
pub owner_user_id: String,
pub charge_ms: u32,
pub drag_distance: f32,
pub drag_vector_x: Option<f32>,
pub drag_vector_y: Option<f32>,
pub client_event_id: String,
pub jumped_at_ms: i64,
}
@@ -152,6 +157,31 @@ pub struct JumpHopRunProcedureResult {
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct JumpHopLeaderboardEntrySnapshot {
pub rank: u32,
pub player_id: String,
pub successful_jump_count: u32,
pub duration_ms: u64,
pub updated_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct JumpHopLeaderboardGetInput {
pub profile_id: String,
pub viewer_player_id: String,
pub limit: u32,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct JumpHopLeaderboardProcedureResult {
pub ok: bool,
pub profile_id: String,
pub items: Vec<JumpHopLeaderboardEntrySnapshot>,
pub viewer_best: Option<JumpHopLeaderboardEntrySnapshot>,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct JumpHopCreatorConfigSnapshot {
@@ -181,10 +211,16 @@ pub struct JumpHopCharacterAssetSnapshot {
#[serde(rename_all = "camelCase")]
pub struct JumpHopTileAssetSnapshot {
pub tile_type: String,
#[serde(default)]
pub tile_id: Option<String>,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub source_atlas_cell: String,
#[serde(default)]
pub atlas_row: Option<u32>,
#[serde(default)]
pub atlas_col: Option<u32>,
pub visual_width: u32,
pub visual_height: u32,
pub top_surface_radius: f32,