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

Crystallo Improvements and Additions #1783

Merged
merged 12 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions data/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ These are just more code.
* bigjump.wav - self-made by wansti
* brick.wav - replaced with a self-made sound submitted by Yaniel, GPLv2+CC-by-sa
* coin.wav - Replaced by a self-made, almost identical sound by wansti
* crystallo-pop.ogg - remixed by weluvgoatz, originally created by fluerescence, licensed under CC0, from https://freesound.org/people/fleurescence/sounds/573153/
* crystallo-shardhit.ogg - remixed by weluvgoatz, originally created by cyoung510, licensed under CC0, from https://freesound.org/people/cyoung510/sounds/521242/
* crystallo-shatter.ogg - remixed by weluvgoatz, originally created by C_Rogers, licensed under CC0, from https://freesound.org/people/C_Rogers/sounds/203377/
* dartfire.wav - self-made by sommer
* darthit.wav - self-made by sommer
* door.wav - self-made by gwater (Jun 30 2006 13:42:40 <gwater> ok it's my squeaky step, but it kind of sounds like a door.)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/images/creatures/crystallo/crystallo-left-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/images/creatures/crystallo/crystallo-left-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/images/creatures/crystallo/crystallo-left-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions data/images/creatures/crystallo/crystallo-overlay.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(supertux-sprite
(action
(name "default")
(hitbox 11 16 32 20)
(images "crystallo-overlay.png"))
)
43 changes: 30 additions & 13 deletions data/images/creatures/crystallo/crystallo.sprite
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
(supertux-sprite
(action
(name "left")
(hitbox 0 7 35 20)
(fps 14)
(hitbox 8 9 32 20)
(images "crystallo-left-0.png"
"crystallo-left-1.png"
"crystallo-left-0.png"
"crystallo-left-2.png")
)
"crystallo-left-2.png"
"crystallo-left-3.png"
"crystallo-left-4.png"
"crystallo-left-5.png"
"crystallo-left-6.png"
"crystallo-left-7.png"))

(action
(hitbox 0 7 35 20)
(name "right")
(mirror-action "left")
)
(fps 14)
(hitbox 8 9 32 20)
(mirror-action "left"))

(action
(name "slowdown-left")
(fps 5)
(hitbox 8 9 32 20)
(clone-action "left"))

(action
(name "slowdown-right")
(fps 5)
(hitbox 8 9 32 20)
(clone-action "right"))

(action
(name "shattered-left")
(images "shattered-left.png")
)
(images "shattered-left.png"))

(action
(name "shattered-right")
(mirror-action "shattered-left")
)
(mirror-action "shattered-left"))

(action
(name "editor")
(hitbox 100 7 135 20)
(images "crystallo-editor.png")
)
(images "crystallo-editor.png"))
)
75 changes: 75 additions & 0 deletions data/images/creatures/crystallo/rcrystallo.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
(supertux-sprite
(action
(name "left")
(fps 14)
(hitbox 8 1 32 25)
(images "crystallo-left-0.png"
"crystallo-left-1.png"
"crystallo-left-2.png"
"crystallo-left-3.png"
"crystallo-left-4.png"
"crystallo-left-5.png"
"crystallo-left-6.png"
"crystallo-left-7.png"))

(action
(name "right")
(fps 14)
(hitbox 8 1 32 25)
(mirror-action "left"))

(action
(name "slowdown-left")
(fps 5)
(hitbox 8 1 32 25)
(clone-action "left"))

(action
(name "slowdown-right")
(fps 5)
(hitbox 8 1 32 25)
(clone-action "right"))

(action
(name "shattered-left")
(images "shattered-left.png"))

(action
(name "shattered-right")
(mirror-action "shattered-left"))

(action
(name "detected-left")
(fps 15)
(hitbox 45 2 20 35)
(loops 1)
(images "crystallo-fall-0.png"
"crystallo-fall-1.png"
"crystallo-fall-2.png"
"crystallo-fall-3.png"
"crystallo-fall-4.png"
"crystallo-fall-5.png"
"crystallo-fall-6.png"
"crystallo-fall-7.png"
"crystallo-fall-6.png"
"crystallo-fall-8.png"
"crystallo-fall-9.png"
"crystallo-fall-8.png"))

(action
(name "detected-right")
(fps 15)
(hitbox 35 2 20 35)
(loops 1)
(mirror-action "detected-left"))

(action
(name "fall-left")
(hitbox 45 2 20 35)
(images "crystallo-fall-10.png"))

(action
(name "fall-right")
(hitbox 35 2 20 35)
(mirror-action "fall-left"))
)
101 changes: 101 additions & 0 deletions data/images/creatures/crystallo/scrystallo.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
(supertux-sprite
(action
(name "editor-left")
(fps 14)
(hitbox 8 13 32 14)
(loops 1)
(images "crystallo-sleeping.png"))

(action
(name "editor-right")
(fps 14)
(hitbox 9 13 32 14)
(loops 1)
(mirror-action "editor-left"))

(action
(name "left")
(fps 14)
(hitbox 8 9 32 20)
(images "crystallo-left-0.png"
"crystallo-left-1.png"
"crystallo-left-2.png"
"crystallo-left-3.png"
"crystallo-left-4.png"
"crystallo-left-5.png"
"crystallo-left-6.png"
"crystallo-left-7.png"))

(action
(name "right")
(fps 14)
(hitbox 8 9 32 20)
(mirror-action "left"))

(action
(name "slowdown-left")
(fps 5)
(hitbox 8 9 32 20)
(clone-action "left"))

(action
(name "slowdown-right")
(fps 5)
(hitbox 8 9 32 20)
(clone-action "right"))

(action
(name "shattered-left")
(images "shattered-left.png"))

(action
(name "shattered-right")
(mirror-action "shattered-left"))

(action
(name "waking-left")
(fps 14)
(hitbox 8 13 32 14)
(loops 1)
(images "crystallo-waking-0.png"
"crystallo-waking-1.png"
"crystallo-sleeping.png"
"crystallo-waking-0.png"
"crystallo-waking-1.png"
"crystallo-waking-1.png"
"crystallo-waking-1.png"
"crystallo-waking-1.png"
"crystallo-preparing-0.png"
"crystallo-preparing-1.png"
"crystallo-preparing-0.png"
"crystallo-preparing-1.png"
"crystallo-preparing-0.png"
"crystallo-preparing-1.png"
"crystallo-preparing-0.png"))

(action
(name "waking-right")
(fps 14)
(hitbox 9 13 32 14)
(loops 1)
(mirror-action "waking-left"))

(action
(name "jumping-left")
(fps 14)
(hitbox 8 9 32 20)
(loops 1)
(images "crystallo-jump-1.png"
"crystallo-jump-2.png"
"crystallo-jump-3.png"
"crystallo-jump-4.png"
"crystallo-jump-5.png"
"crystallo-jump-6.png"))

(action
(name "jumping-right")
(fps 14)
(hitbox 8 9 32 20)
(loops 1)
(mirror-action "jumping-left"))
)
Binary file added data/images/creatures/crystallo/shard.png
6 changes: 6 additions & 0 deletions data/images/creatures/crystallo/shard.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(supertux-sprite
(action
(name "default")
(hitbox 8 8 16 16)
(images "shard.png"))
)
Binary file modified data/images/creatures/crystallo/shattered-left.png
6 changes: 6 additions & 0 deletions data/images/engine/editor/objects.stoi
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
(object
(class "crystallo")
(icon "images/creatures/crystallo/crystallo-left-0.png"))
(object
(class "scrystallo")
(icon "images/creatures/crystallo/crystallo-sleeping.png"))
(object
(class "rcrystallo")
(icon "images/creatures/crystallo/rcrystallo-editor.png"))
(object
(class "icecrusher")
(icon "images/creatures/icecrusher/iceblock.png"))
Expand Down
Binary file added data/sounds/crystallo-pop.ogg
Binary file not shown.
Binary file added data/sounds/crystallo-shardhit.ogg
Binary file not shown.
Binary file added data/sounds/crystallo-shatter.ogg
Binary file not shown.
27 changes: 13 additions & 14 deletions src/badguy/crystallo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Crystallo::Crystallo(const ReaderMapping& reader) :
{
walk_speed = 80;
max_drop_height = 16;

reader.get("radius", m_radius, 100.0f);
}

Expand All @@ -43,26 +42,26 @@ Crystallo::get_settings()
void
Crystallo::active_update(float dt_sec)
{
if (get_pos().x > (m_start_position.x + m_radius)) {
if (m_dir != Direction::LEFT){
turn_around();
}
}

if (get_pos().x < (m_start_position.x - m_radius)) {
if (m_dir != Direction::RIGHT){
turn_around();
}
}

BadGuy::active_update(dt_sec);
//walking and turning properly
float targetwalk = m_dir == Direction::LEFT ? -80.f : 80.f;
if (m_dir != Direction::LEFT && get_pos().x > (m_start_position.x + m_radius - 20.f))
targetwalk = -80.f;
if (m_dir != Direction::RIGHT && get_pos().x < (m_start_position.x - m_radius + 20.f))
targetwalk = 80.f;
set_action(std::abs(m_physic.get_velocity_x()) < 80.f ?
m_dir == Direction::LEFT ? "slowdown-left" : "slowdown-right" :
m_dir == Direction::LEFT ? "left" : "right", -1);
WalkingBadguy::active_update(dt_sec, targetwalk, 2.f);
}

bool
Crystallo::collision_squished(GameObject& object)
{
set_action(m_dir == Direction::LEFT ? "shattered-left" : "shattered-right", /* loops = */ -1, ANCHOR_BOTTOM);
kill_squished(object);
m_physic.set_gravity_modifier(1.f);
m_physic.set_velocity_x(0.0);
m_physic.set_acceleration_x(0.0);
return true;
}

Expand Down
Loading