Skip to content

Feedback #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: feedback
Choose a base branch
from
Open

Feedback #1

wants to merge 51 commits into from

Conversation

github-classroom[bot]
Copy link
Contributor

@github-classroom github-classroom bot commented Nov 12, 2022

👋! GitHub Classroom created this pull request as a place for your teacher to leave feedback on your work. It will update automatically. Don’t close or merge this pull request, unless you’re instructed to do so by your teacher.
In this pull request, your teacher can leave comments and feedback on your code. Click the Subscribe button to be notified if that happens.
Click the Files changed or Commits tab to see all of the changes pushed to main since the assignment started. Your teacher can see this too.

Notes for teachers

Use this PR to leave feedback. Here are some tips:

  • Click the Files changed tab to see all of the changes pushed to main since the assignment started. To leave comments on specific lines of code, put your cursor over a line of code and click the blue + (plus sign). To learn more about comments, read “Commenting on a pull request”.
  • Click the Commits tab to see the commits pushed to main. Click a commit to see specific changes.
  • If you turned on autograding, then click the Checks tab to see the results.
  • This page is an overview. It shows commits, line comments, and general comments. You can leave a general comment below.
    For more information about this pull request, read “Leaving assignment feedback in GitHub”.

Subscribed: @jkurys @Kinzoku99


In the second part we're going to add random map generator, saving/loading, scores and a more sophisticated AI.
In the second part we're going to add recursive boxes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A cóż to takiego?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chodzi o to, żeby pudełka mogły być jakby mini-poziomami, opcjonalnie zawierającymi inne pudełka/punkty końcowe. Podobnie jak w grze Patrick's Parabox: https://store.steampowered.com/app/1260520/Patricks_Parabox/

Copy link

@agluszak agluszak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funkcje próbują za dużo robić. Trochę jest spaghetti code, który wynika, zdaje się, głównie z niezbyt dobrego ogarnięcia konceptów ECS. W "keyboard_input_system" nie powinniście wywoływać funkcji, które potem wywołują jeszcze inne funkcje odpowiadające za logikę gry... Systemy powinny być od siebie maksymalnie niezależne i brać jak najmniej inputów.

4/5

}

//render an object with a given image and position
fn spawn_entity<T>(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ta funkcja próbuje za dużo robić. Proponuję osobno dodać obrazek do materials, a zamiast ręcznego spawnowania wewnątrz tej funkcji proponuję stworzyć nowy Bundle (Bundle mogą być zagnieżdżone w Bundlach) i zrobić konstruktor do niego

for j in left_border..(right_border + 1) {
let entity = board
.entities
.get(&Position { x: j, y: i })
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to może lepiej x zamiast j i y zamiast i...?

Comment on lines 13 to 22
impl PartialEq for GameObjects {
fn eq(&self, other: &Self) -> bool {
match (self, other) {
(Self::Box(_), Self::Box(_)) => true, //we do not care about the insides of Box when comapring
(Self::Wall, Self::Wall) => true,
(Self::Empty, Self::Empty) => true,
_ => false,
}
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skoro nadpisujecie PartialEq to warto się zastanowić, czy ten enum jest dobrym miejscem do trzymania tych danych, które tutaj ignorujecie, in the first place

Down,
Left,
Right,
None,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesujący kierunek

Comment on lines 20 to 23
board.entities.remove(&old_position);
board
.entities
.insert(next_position, GameObjects::Box(Some(current_entity)));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a czemu nie zmienić po prostu tego jednego komponentu? (zamiast usuwać i dodawać nową entity)

.insert(next_position, GameObjects::Box(Some(current_entity)));
}

fn update_box(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bardzo mało mówiąca nazwa funkcji, która próbuje zrobić bardzo dużo różnych rzeczy

let (mut player, mut transform) = sprite_position.single_mut();
let new_position = player.position.neighbour(direction);
if direction == Direction::None {
()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to niepotrzebne zupełnie

}
}

fn update_pos(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

za dużo robi ta funkcja

Comment on lines 116 to 122
// move is only possible once every MOVE_DELAY seconds so only when timer is finished
let dir = set_direction(keyboard_input);
if timer.0.finished() {
update_pos(sprite_position, dir, timer, &mut board, &mut boxes);
} else {
timer.0.tick(time.delta());
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to niedobry pomysł... zastanawiałem się czemu to chodzenie jest takie nieresponsywne. Ja bym chyba to zrobił tak: przez MOVE_DELAY czasu zbierać input i pamiętać ostatni (jeśli jakikolwiek był - Option, a nie Direction::None!) w resource, a po upływie MOVE_DELAY przeprocesować ruch

@@ -0,0 +1,38 @@
use bevy::prelude::*;

pub fn spawn_button<T>(parent: &mut ChildBuilder, entity: T, menu_font: Handle<Font>, value: &str)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

takie różne "utils" to raczej do mod.rs powinny iść, a na pewno nie do osobnego pliku, bo potem trzeba go importować przez use cośtam::spawn_button::spawn_button

Copy link

@agluszak agluszak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bardzo ładnie, 5/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants