Skip to content

Commit

Permalink
Merge pull request #4 from SnowdenWintermute/feature
Browse files Browse the repository at this point in the history
0.2.1
  • Loading branch information
SnowdenWintermute authored Jan 26, 2024
2 parents 84b38f4 + 1164941 commit 5f8a47a
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 30 deletions.
6 changes: 3 additions & 3 deletions client/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

<base href="/">

<link rel="preload" href="/roguelike-racing-client-8b44f5306eb3adda_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="/roguelike-racing-client-8b44f5306eb3adda.js"></head>
<link rel="preload" href="/roguelike-racing-client-471b113b9deca254_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="/roguelike-racing-client-471b113b9deca254.js"></head>
<body>

<script type="module">import init from '/roguelike-racing-client-8b44f5306eb3adda.js';init('/roguelike-racing-client-8b44f5306eb3adda_bg.wasm');</script><script>(function () {
<script type="module">import init from '/roguelike-racing-client-471b113b9deca254.js';init('/roguelike-racing-client-471b113b9deca254_bg.wasm');</script><script>(function () {
var protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
var url = protocol + '//' + window.location.host + '/_trunk/ws';
var poll_interval = 5000;
Expand Down
5 changes: 3 additions & 2 deletions client/src/components/game/action_menu/action_page_buttons.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::store::game_store::GameStore;
use gloo::events::EventListener;
use gloo_utils::window;
use wasm_bindgen::{JsCast, UnwrapThrowExt};
use wasm_bindgen::JsCast;
use wasm_bindgen::UnwrapThrowExt;
use yew::prelude::*;
use yewdux::prelude::use_store;

Expand Down Expand Up @@ -56,7 +57,7 @@ pub fn action_page_buttons(props: &Props) -> Html {
if event.code() == "KeyW" {
cloned_prev_page();
}
if event.code() == "KeyE" {
if event.code() == "KeyR" {
cloned_next_page();
}
});
Expand Down
1 change: 0 additions & 1 deletion client/src/components/game/top_info_bar/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub fn game() -> Html {
.iter()
.enumerate()
.map(|(i, room_type_option )| {
log!(format!("room box index: {i} explored on current floor: {}", party.rooms_explored.on_current_floor));
let current_room_class = if party.rooms_explored.on_current_floor == ( i + 1 ) as u16 {
"border-yellow-400"
} else {
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/lobby/game_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub fn game_list() -> Html {
let (lobby_state, _) = use_store::<LobbyStore>();

html!(
<section class="flex-1 p-4 mr-4 bg-slate-700 border border-slate-400 overflow-y-scroll" id="game_list">
<section class="flex-1 p-4 mr-4 bg-slate-700 border border-slate-400 overflow-y-auto" id="game_list">
<h2 class="text-slate-200 text-l mb-2">{ "Games" }</h2>
<ul class="list-none">
{lobby_state.game_list.iter().map(|game|
Expand Down
84 changes: 64 additions & 20 deletions client/src/components/lobby/welcome_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,72 @@ use yew::prelude::*;

#[function_component(WelcomeInfo)]
pub fn welcome_info() -> Html {
let show_patch_notes_state = use_state(|| false);
let cloned_show_patch_notes_state = show_patch_notes_state.clone();
let handle_show_patch_notes_click = Callback::from(move |_| {
let new_state = !*cloned_show_patch_notes_state;
cloned_show_patch_notes_state.set(new_state);
});
html!(
<section class="flex-1 p-4 mb-4 mr-4 bg-slate-700 border border-slate-400 overflow-y-scroll">
<h3 class="text-lg">{"Roguelike Racing"}</h3>
<h5 class="mb-2">
{"alpha 0.2.0"}
</h5>
<p class="mb-2">
{"Welcome to the early alpha of Roguelike Racing, a multiplayer turn based
<section class="flex-1 p-4 mb-4 mr-4 bg-slate-700 border border-slate-400 overflow-y-auto">
<h3 class="text-lg">{"Roguelike Racing"}</h3>
<button onclick={handle_show_patch_notes_click} class="mb-2">
{"alpha 0.2.1 ⓘ"}
</button>
if *show_patch_notes_state == false {
<WelcomeMessage />
} else {
<PatchNotes />
}
</section>
)
}

#[function_component(PatchNotes)]
fn welcome_message() -> Html {
html!(
<>
<p>{"0.2.1"}</p>
<ul class="list-disc list-inside mb-1">
<li>{"Added patch notes section to welcome info"}</li>
<li>{"Fixed a bug where the room exploration tracker wouldn't work on any floor except the first"}</li>
</ul>
<p>{"0.2.0"}</p>
<p>{"Fixed bugs:"}</p>
<ul class="list-disc list-inside mb-1">
<li>{"players couldn't attack while wearing a shield"}</li>
<li>{"unequipping an item would not change focus to the unequipped item"}</li>
</ul>
<p>{"Added features:"}</p>
<ul class="list-disc list-inside mb-1">
<li>{"Stairs down now appear in the dungeon and players can vote to keep exploring the current floor or descend to the next one"}</li>
<li>{"An explored rooms tracker now appears as part of the top info bar"}</li>
<li>{"The top info bar can be re positioned by clicking on it"}</li>
</ul>
</>
)
}

#[function_component(WelcomeMessage)]
fn welcome_message() -> Html {
html!(
<>
<p class="mb-2">
{"Welcome to the early alpha of Roguelike Racing, a multiplayer turn based
RPG in the spirit of For the King, Diablo and Final Fantasy. All layout and graphics are placeholders.
There is a minimum playable game in which you can do the following:"}
</p>
<ul class="list-disc list-inside" >
<li>{"Create and join games which consist of one or more adventuring parties"}</li>
<li>{"Create a party with one or more players each controlling one or more characters"}</li>
<li>{"Explore rooms of the dungeon which may contain monsters"}</li>
<li>{"Battle monsters and receive randomly generated equipment"}</li>
<li>{"Equip, trade and discard equipment"}</li>
<li>{"Try to reach the lowest floor of the dungeon by descending the stairs"}</li>
</ul>
<p>
{"a lot is not implemented, balanced or at all good, but if anything is severely broken you can report it at https://github.com/SnowdenWintermute/roguelike-racing/issues"}
</p>
</section>
</p>
<ul class="list-disc list-inside" >
<li>{"Create and join games which consist of one or more adventuring parties"}</li>
<li>{"Create a party with one or more players each controlling one or more characters"}</li>
<li>{"Explore rooms of the dungeon which may contain monsters"}</li>
<li>{"Battle monsters and receive randomly generated equipment"}</li>
<li>{"Equip, trade and discard equipment"}</li>
<li>{"Try to reach the lowest floor of the dungeon by descending the stairs"}</li>
</ul>
<p>
{"a lot is not implemented, balanced or at all good, but if anything is severely broken you can report it at https://github.com/SnowdenWintermute/roguelike-racing/issues"}
</p>
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub fn new_dungeon_room_types_on_current_floor(
game_dispatch: Dispatch<GameStore>,
packet: VecDeque<Option<DungeonRoomTypes>>,
) -> Result<(), AppError> {
log!("got new room types list");
game_dispatch.reduce_mut(|store| {
let party = store.get_current_party_mut()?;
party.client_current_floor_rooms_list = packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ impl GameServer {
let loot_option = if in_monster_lair && all_opponents_are_dead {
let mut loot = vec![];
println!("creating loot for dlvl {dlvl}");
// for _ in 0..num_opponents {
for _ in 0..30 {
for _ in 0..num_opponents {
// for _ in 0..30 {
loot.push(Item::generate(&mut game.id_generator, dlvl))
}
Some(loot)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl GameServer {
if all_players_ready_to_descend {
// increase the floor count
party.current_floor += 1;
party.generate_unexplored_rooms_queue();
party.unexplored_rooms.clear();
let current_floor = party.current_floor;
party.players_ready_to_descend.clear();
let player_usernames = party.player_usernames.clone();
Expand Down

0 comments on commit 5f8a47a

Please sign in to comment.