Skip to content
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

Fire breath ability #69

Merged
merged 6 commits into from
Nov 18, 2023
Merged

Fire breath ability #69

merged 6 commits into from
Nov 18, 2023

Conversation

cnmorales
Copy link
Collaborator

@cnmorales cnmorales commented Nov 16, 2023

Issue:

Closes #36

What was done:

  • Added Bevy Particles System
  • Added SpawnFireBreathEvent
  • Added fire particle to spawn when the key is pressed
  • Added collisions between fire and enemies

Copy link
Owner

@mnmaita mnmaita left a comment

Choose a reason for hiding this comment

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

Fantastico amigo, te dejo algunos comentarios.

src/game/player.rs Outdated Show resolved Hide resolved
src/game/player.rs Outdated Show resolved Hide resolved
src/game/player.rs Outdated Show resolved Hide resolved
src/game/player.rs Outdated Show resolved Hide resolved
{
info!("event received");
commands.spawn(ParticleSystemBundle {
transform: Transform::from_translation(position.extend(1.0)),
Copy link
Owner

Choose a reason for hiding this comment

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

Hay algunas particulas que se dibujan abajo de algunas tiles, no se por que. Tendriamos que ver bien los valores z de todos los transforms y quizas crear constantes f32 que representen "layers" de dibujado. 0 para el fondo/tiles, 1 para los edificios, 2 para las entidades que se mueven en la tierra, 3 para las que vuelan... etc. y ver si ese es el problema.

src/game/player.rs Outdated Show resolved Hide resolved
src/game/mod.rs Outdated Show resolved Hide resolved
src/input.rs Outdated Show resolved Hide resolved
src/input.rs Outdated Show resolved Hide resolved
@mnmaita
Copy link
Owner

mnmaita commented Nov 17, 2023

Hoy descubri como conseguir el "vector direccion" del Player en base a la rotacion del transform:

let direction = transform.rotation.mul_vec3(Vec3::Y).truncate();

No hace falta hacer toda esa gilada de tener un componente Direction como te habia dicho. Creo que ya estaria normalizado, sino por las dudas podes hacer un .normalize() al final y luego lo escalas con algun valor f32 hasta que parezca que sale de la cabeza. Y ese valor lo podrias obtener del size Y del sprite del jugador (queriando Sprite) o, cuando mergeemos la fisica para el dragon, del radio del Collider (creo) para no tener que hardcodearlo.

@cnmorales cnmorales force-pushed the feature/fire-breath-ability branch from 570aa3a to 5b1d43a Compare November 18, 2023 14:37
@cnmorales cnmorales force-pushed the feature/fire-breath-ability branch from 705bbbb to f9570f1 Compare November 18, 2023 14:49
@cnmorales cnmorales removed the DRAFT label Nov 18, 2023
@mnmaita mnmaita changed the title Feature/fire breath ability Fire breath ability Nov 18, 2023
@mnmaita mnmaita merged commit 9e3475b into main Nov 18, 2023
3 checks passed
@mnmaita mnmaita deleted the feature/fire-breath-ability branch November 18, 2023 23:51
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.

Dragon Fire Breath Ability
2 participants