profile
viewpoint

amethyst/space_shooter_rs 123

A space shooter game made with Amethyst and Rust.

tigleym/sprite_animations_demo 4

Demo for sprite animations using the Amethyst game engine

tigleym/amethyst-simple-animations 3

Simple animations for rendering 2D sprites with Amethyst.

CPSC3780/Command-Line-Chat-Client-Server 0

Course project that implements a chat server and client over UDP with a command line interface using C++. (There is also a compatible client for Android written in Java)

tigleym/amethyst 0

Data-oriented and data-driven game engine written in Rust

tigleym/data-review 0

Templates for Firefox data collection review process (https://wiki.mozilla.org/Firefox/Data_Collection)

tigleym/DR_map 0

A 2D sprite-based roguelike using the Dragon Ruby game engine. Used to experiment ideas while learning how to develop a roguelike.

tigleym/dwarf_seeks_fortune 0

A 2D puzzle platformer made with the Amethyst game engine.

tigleym/GSOC2020 0

Mozilla and GSOC 2020

created repositoryCleanCut/dotfiles

My dotfiles

created time in 3 hours

Pull request review commentamethyst/space_shooter_rs

Cdsupina/motion2d refactor

 use crate::{-    components::{Hitbox2DComponent, Motion2DComponent},-    constants::{ARENA_MAX_X, ARENA_MAX_Y, ARENA_MIN_X, ARENA_MIN_Y},+    components::{EnemyComponent, EnemyType, Hitbox2DComponent, Motion2DComponent},+    constants::{ARENA_HEIGHT, ARENA_MAX_X, ARENA_MAX_Y, ARENA_MIN_X, ARENA_MIN_Y},+    events::EnemyReachedBottomEvent, }; use amethyst::{-    core::transform::Transform,-    ecs::prelude::{Join, ReadStorage, System, WriteStorage},+    core::{timing::Time, transform::Transform},+    ecs::prelude::{Entities, Entity, Join, Read, ReadStorage, System, Write, WriteStorage},+    shrev::EventChannel, }; -pub struct ConstrainToArenaSystem;+// basic physics for all Motion2D entities+pub struct Motion2DSystem; -impl<'s> System<'s> for ConstrainToArenaSystem {+impl<'s> System<'s> for Motion2DSystem {     type SystemData = (-        ReadStorage<'s, Hitbox2DComponent>,+        WriteStorage<'s, Motion2DComponent>,         WriteStorage<'s, Transform>,+        Read<'s, Time>,+    );++    fn run(&mut self, (mut motion_2ds, mut transforms, time): Self::SystemData) {+        for (motion_2d, transform) in (&mut motion_2ds, &mut transforms).join() {+            let dt = time.delta_seconds();++            // update translation based on velocity and delta time+            transform.set_translation_xyz(+                transform.translation().x + motion_2d.velocity.x * dt,+                transform.translation().y + motion_2d.velocity.y * dt,+                transform.translation().z,+            );++            // update angle based on angular velocity and time+            transform.append_rotation_z_axis(motion_2d.angular_velocity * dt);++            // limit speed in the x direction to the max speed+            if motion_2d.velocity.x.abs() > motion_2d.max_speed.x {+                if motion_2d.velocity.x >= 0.0 {+                    motion_2d.velocity.x = motion_2d.max_speed.x;+                } else {+                    motion_2d.velocity.x = -motion_2d.max_speed.x;+                }+            }++            // limit speed in the y direction to the max speed+            if motion_2d.velocity.y.abs() > motion_2d.max_speed.y {+                if motion_2d.velocity.y >= 0.0 {+                    motion_2d.velocity.y = motion_2d.max_speed.y;+                } else {+                    motion_2d.velocity.y = -motion_2d.max_speed.y;+                }+            }+        }+    }+}++// motion behavior for enemies+pub struct EnemyMotion2DSystem;++impl<'s> System<'s> for EnemyMotion2DSystem {+    type SystemData = (+        Entities<'s>,+        ReadStorage<'s, EnemyComponent>,         WriteStorage<'s, Motion2DComponent>,+        WriteStorage<'s, Transform>,+        ReadStorage<'s, Hitbox2DComponent>,+        Write<'s, EventChannel<EnemyReachedBottomEvent>>,     ); -    fn run(&mut self, (hitboxes, mut transforms, mut motions): Self::SystemData) {-        for (hitbox, transform, motion) in (&hitboxes, &mut transforms, &mut motions).join() {-            let x_pos = transform.translation().x - (hitbox.width / 2.0);-            let y_pos = transform.translation().y - (hitbox.height / 2.0);+    fn run(+        &mut self,+        (+            entities,+            enemies,+            mut motion_2ds,+            mut transforms,+            hitbox_2ds,+            mut enemy_reached_bottom_event_channel,+        ): Self::SystemData,+    ) {+        for (enemy, motion_2d, hitbox_2d, transform, entity) in (+            &enemies,+            &mut motion_2ds,+            &hitbox_2ds,+            &mut transforms,+            &entities,+        )+            .join()+        {+            move_enemy(&enemy, transform, motion_2d);++            constrain_enemies_to_arena(+                &enemy,+                transform,+                motion_2d,+                hitbox_2d,+                &entity,+                &mut enemy_reached_bottom_event_channel,+                &entities,+            );+        }+    }+}++fn move_enemy(+    enemy: &EnemyComponent,+    transform: &mut Transform,+    motion_2d: &mut Motion2DComponent,+) {+    match enemy.enemy_type {+        EnemyType::Pawn => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Drone => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Hauler => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Strafer => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+            // accelerate in x direction+            motion_2d.velocity.x += motion_2d.acceleration.x;+        }+        EnemyType::MissileLauncher => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Missile => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::RepeaterBody => {+            // move down to position and then accelerate backwards+            if transform.translation().y > ARENA_MIN_Y + ARENA_HEIGHT - 30.0 {

I think we should leave this as is until we work on the boss part hierarchy.

cdsupina

comment created time in 21 hours

Pull request review commentamethyst/space_shooter_rs

Cdsupina/motion2d refactor

 use crate::{-    components::{Hitbox2DComponent, Motion2DComponent},-    constants::{ARENA_MAX_X, ARENA_MAX_Y, ARENA_MIN_X, ARENA_MIN_Y},+    components::{EnemyComponent, EnemyType, Hitbox2DComponent, Motion2DComponent},+    constants::{ARENA_HEIGHT, ARENA_MAX_X, ARENA_MAX_Y, ARENA_MIN_X, ARENA_MIN_Y},+    events::EnemyReachedBottomEvent, }; use amethyst::{-    core::transform::Transform,-    ecs::prelude::{Join, ReadStorage, System, WriteStorage},+    core::{timing::Time, transform::Transform},+    ecs::prelude::{Entities, Entity, Join, Read, ReadStorage, System, Write, WriteStorage},+    shrev::EventChannel, }; -pub struct ConstrainToArenaSystem;+// basic physics for all Motion2D entities+pub struct Motion2DSystem; -impl<'s> System<'s> for ConstrainToArenaSystem {+impl<'s> System<'s> for Motion2DSystem {     type SystemData = (-        ReadStorage<'s, Hitbox2DComponent>,+        WriteStorage<'s, Motion2DComponent>,         WriteStorage<'s, Transform>,+        Read<'s, Time>,+    );++    fn run(&mut self, (mut motion_2ds, mut transforms, time): Self::SystemData) {+        for (motion_2d, transform) in (&mut motion_2ds, &mut transforms).join() {+            let dt = time.delta_seconds();++            // update translation based on velocity and delta time+            transform.set_translation_xyz(+                transform.translation().x + motion_2d.velocity.x * dt,+                transform.translation().y + motion_2d.velocity.y * dt,+                transform.translation().z,+            );++            // update angle based on angular velocity and time+            transform.append_rotation_z_axis(motion_2d.angular_velocity * dt);++            // limit speed in the x direction to the max speed+            if motion_2d.velocity.x.abs() > motion_2d.max_speed.x {+                if motion_2d.velocity.x >= 0.0 {+                    motion_2d.velocity.x = motion_2d.max_speed.x;+                } else {+                    motion_2d.velocity.x = -motion_2d.max_speed.x;+                }+            }++            // limit speed in the y direction to the max speed+            if motion_2d.velocity.y.abs() > motion_2d.max_speed.y {+                if motion_2d.velocity.y >= 0.0 {+                    motion_2d.velocity.y = motion_2d.max_speed.y;+                } else {+                    motion_2d.velocity.y = -motion_2d.max_speed.y;+                }+            }+        }+    }+}++// motion behavior for enemies+pub struct EnemyMotion2DSystem;++impl<'s> System<'s> for EnemyMotion2DSystem {+    type SystemData = (+        Entities<'s>,+        ReadStorage<'s, EnemyComponent>,         WriteStorage<'s, Motion2DComponent>,+        WriteStorage<'s, Transform>,+        ReadStorage<'s, Hitbox2DComponent>,+        Write<'s, EventChannel<EnemyReachedBottomEvent>>,     ); -    fn run(&mut self, (hitboxes, mut transforms, mut motions): Self::SystemData) {-        for (hitbox, transform, motion) in (&hitboxes, &mut transforms, &mut motions).join() {-            let x_pos = transform.translation().x - (hitbox.width / 2.0);-            let y_pos = transform.translation().y - (hitbox.height / 2.0);+    fn run(+        &mut self,+        (+            entities,+            enemies,+            mut motion_2ds,+            mut transforms,+            hitbox_2ds,+            mut enemy_reached_bottom_event_channel,+        ): Self::SystemData,+    ) {+        for (enemy, motion_2d, hitbox_2d, transform, entity) in (+            &enemies,+            &mut motion_2ds,+            &hitbox_2ds,+            &mut transforms,+            &entities,+        )+            .join()+        {+            move_enemy(&enemy, transform, motion_2d);++            constrain_enemies_to_arena(+                &enemy,+                transform,+                motion_2d,+                hitbox_2d,+                &entity,+                &mut enemy_reached_bottom_event_channel,+                &entities,+            );+        }+    }+}++fn move_enemy(+    enemy: &EnemyComponent,+    transform: &mut Transform,+    motion_2d: &mut Motion2DComponent,+) {+    match enemy.enemy_type {+        EnemyType::Pawn => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Drone => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Hauler => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Strafer => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+            // accelerate in x direction+            motion_2d.velocity.x += motion_2d.acceleration.x;+        }+        EnemyType::MissileLauncher => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::Missile => {+            // accelerate in negative y direction+            motion_2d.velocity.y += motion_2d.acceleration.y;+        }+        EnemyType::RepeaterBody => {+            // move down to position and then accelerate backwards+            if transform.translation().y > ARENA_MIN_Y + ARENA_HEIGHT - 30.0 {

These were used in the previous enemy.rs system as well. These arbitrary numbers just indicate a position on the y axis in the arena. Once the parts reach the arbitrary position they stop accelerating downward and reverse acceleration in the other direction resulting in the oscillation. These arbitrary numbers line each of the boss parts up with each other to make it appear that the boss is one cohesive unit.

cdsupina

comment created time in 21 hours

startedseancribbs/datalog-elixir

started time in a day

startedrobinhilliard/safeish

started time in a day

PR opened amethyst/space_shooter_rs

Cdsupina/motion2d refactor

General motion in Motion2DSystem

Enemy motion in EnemyMotion2DSystem.

+243 -184

0 comment

8 changed files

pr created time in 2 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha d66513f6c8e7534b55ffb7db4b149120c43bb6f1

comment, and clean up old code

view details

push time in 2 days

startedsasa1977/ci

started time in 4 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha 75f750f480425b51fd6e74ecc8114bfd2c9c4135

limit speed of enemies to max_speed, despawn upon reaching the bottom

view details

push time in 4 days

startedbheisler/iai

started time in 5 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha 5455602802cc4c6a301f69fbd484a6b7c1c1b38c

add enemymotion2dsystem with basic logic for 3 enemies

view details

push time in 7 days

startedaseprite/aseprite

started time in 7 days

created repositorycarlogilmar/learning_erlang

created time in 7 days

startedZennerIoT/maracuja

started time in 7 days

startedgoogle/eng-practices

started time in 7 days

startedapptension/developer-handbook

started time in 7 days

startederlang/otp

started time in 7 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha a4bdd38b61232531d1d85a409918fbb5347d340b

begin implmenting motion2d and enemy motion systems

view details

push time in 8 days

create barnchamethyst/space_shooter_rs

branch : cdsupina/motion2d_refactor

created branch time in 8 days

PublicEvent

created repository9999years/berry.dog-forestry-eleventy

created time in 9 days

created repository9999years/berry-dog-netlify

created time in 9 days

created repository9999years/berry.dog

created time in 9 days

startedkillercup/cargo-edit

started time in 10 days

startedrainglow/iterm

started time in 10 days

startedcksac/fake-rs

started time in 10 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha bcea3e9d6d645a23e5a2db79d4f57069a7638019

change ability component to use special ability trait

view details

push time in 12 days

startedhexpm/hexdocs

started time in 12 days

startedjaviergarea/makeup_html

started time in 13 days

push eventamethyst/space_shooter_rs

Carlo Supina

commit sha 9a94aeb9723c7bacc627d688edca0794f2c183b9

end action function

view details

push time in 14 days

more