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

Root Sapling (a.k.a. Corrupted Mole) #2698

Merged
merged 58 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
8af51da
Initial sprites for Root Sapling [ci skip]
Rusty-Box Dec 10, 2023
4baf94d
Update root_attack.sprite [ci skip]
Rusty-Box Dec 15, 2023
c1ea7fb
Delete data/images/creatures/mole/corrupted/root_base.sprite [ci skip]
Rusty-Box Dec 15, 2023
6a93716
Rename root_attack.sprite to root.sprite [ci skip]
Rusty-Box Dec 15, 2023
1c2e4cf
wip root sapling
MatusGuy Dec 16, 2023
ebc10d6
root sapling basic behaviour
MatusGuy Dec 17, 2023
586a7fa
Merge branch 'SuperTux:master' into root-sapling
Rusty-Box Dec 17, 2023
7f4380d
Particles, fine tuning, and death
MatusGuy Dec 17, 2023
b173066
Merge branch 'root-sapling' of https://github.com/Rusty-Box/supertux …
MatusGuy Dec 17, 2023
cba5ca4
summon roots on different ground levels
MatusGuy Dec 17, 2023
b71d000
Add root to game object factory
MatusGuy Dec 20, 2023
50bff43
Root will only kill COLGROUP_MOVING objects
MatusGuy Dec 20, 2023
ef11852
Add glow sprites for the Root Sapling's core [ci skip]
Rusty-Box Dec 21, 2023
9d840ca
Glowing root sapling
MatusGuy Dec 21, 2023
bbce263
Root sapling do not spawn in thin platforms
MatusGuy Dec 21, 2023
86ee558
Update objects.stoi [ci skip]
Rusty-Box Dec 21, 2023
3a82433
Adjustments
MatusGuy Dec 21, 2023
3241702
Merge branch 'root-sapling' of github.com:Rusty-Box/supertux into roo…
MatusGuy Dec 21, 2023
2892df7
remove unused variables
MatusGuy Dec 25, 2023
7b26652
construct function + wip support all directions
MatusGuy Jan 2, 2024
d60dd60
Merge branch 'root-sapling' of github.com:Rusty-Box/supertux into roo…
MatusGuy Jan 2, 2024
5ae94bf
aeiou
MatusGuy Jan 2, 2024
19dfa71
Support for down + actions for all sides
MatusGuy Jan 7, 2024
94635e7
horizontal textures
MatusGuy Jan 22, 2024
5182555
all sides!!!!!
MatusGuy Jan 22, 2024
6c269b2
hit down facing saplings
MatusGuy Jan 22, 2024
4a99708
Update Root Sapling sprites [ci skip]
Rusty-Box Jan 23, 2024
aea5873
Preparing for crusher new roots
MatusGuy Jan 23, 2024
ed042f6
Merge branch 'root-sapling' of https://github.com/Rusty-Box/supertux …
MatusGuy Jan 23, 2024
bad5506
Merge branch 'SuperTux:master' into root-sapling
MatusGuy Jan 26, 2024
1ee0c0e
fixes
MatusGuy Jan 26, 2024
73cd7bd
Merge branch 'root-sapling' of https://github.com/Rusty-Box/supertux …
MatusGuy Jan 26, 2024
72b8d12
Revert is_free_of_tiles and fix detection
MatusGuy Feb 26, 2024
f02508f
fix more bugs
MatusGuy Feb 26, 2024
d7ecaa8
Merge branch 'SuperTux:master' into root-sapling
Rusty-Box Feb 26, 2024
da354a1
picky compiler
MatusGuy Feb 26, 2024
e59ee84
Merge branch 'root-sapling' of https://github.com/Rusty-Box/supertux …
MatusGuy Feb 26, 2024
f0648e1
oops
MatusGuy Feb 26, 2024
e659c62
fix layers and bottom root sapling spawning even when not full
MatusGuy Mar 2, 2024
41d593e
whoops
MatusGuy Mar 2, 2024
a0f058f
moving tilemaps are stupid
MatusGuy Mar 3, 2024
21a0e72
fix warnings
MatusGuy Mar 10, 2024
584c72c
Fix get_action_surfaces warning
MatusGuy Mar 10, 2024
87354f0
Fix summon check when theres a moving tilemap
MatusGuy Mar 10, 2024
f37b90b
fix the fixes
MatusGuy Mar 13, 2024
5a4f34c
Fix down/right not choosing the right position
MatusGuy Mar 20, 2024
396bba9
remove todo [ci skip]
MatusGuy Mar 22, 2024
4ce2da0
Give Mole bigger hill size [ci skip]
Rusty-Box Mar 23, 2024
4c76868
Merge branch 'SuperTux:master' into root-sapling
MatusGuy Mar 23, 2024
d110442
random mole rock & mole bounce on squish
MatusGuy Mar 23, 2024
a074434
Code style fixes
Vankata453 Mar 24, 2024
86dceab
support multiple players
MatusGuy Mar 26, 2024
1719b09
mole is snipable
MatusGuy Mar 26, 2024
6cba68a
Merge branch 'root-sapling' of https://github.com/Rusty-Box/supertux …
MatusGuy Mar 26, 2024
4e0b393
Replace `return` with `continue`
Vankata453 Mar 26, 2024
32ba221
fix down root sapling
MatusGuy Mar 27, 2024
a6f40e2
bonk on down root sapling inverts velocity
MatusGuy Mar 27, 2024
128837f
faster root sapling
MatusGuy Mar 27, 2024
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
Binary file modified data/images/creatures/mole/center.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.
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.
27 changes: 27 additions & 0 deletions data/images/creatures/mole/corrupted/core_glow/core_glow.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(supertux-sprite
(action
(name "default")
(hitbox 183 193 350 350)
(fps 12)
(images "core_glow-0.png"
"core_glow-1.png"
"core_glow-2.png"
"core_glow-3.png"
"core_glow-4.png"
"core_glow-5.png"
"core_glow-6.png"
"core_glow-7.png"
"core_glow-8.png"
"core_glow-9.png"
"core_glow-10.png"
"core_glow-9.png"
"core_glow-8.png"
"core_glow-7.png"
"core_glow-6.png"
"core_glow-5.png"
"core_glow-4.png"
"core_glow-3.png"
"core_glow-2.png"
"core_glow-1.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.
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.
42 changes: 42 additions & 0 deletions data/images/creatures/mole/corrupted/root.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
(supertux-sprite
(action
(name "root")
(hitbox 20 7 16 80)
(images "root_attack.png"))

(action
(name "root-up")
(hitbox 20 7 16 80)
(clone-action "root"))
(action
(name "base-up")
(hitbox 20 7 16 80)
(images "root_base.png"))

(action
(name "root-down")
(hitbox 20 9 16 80)
(flip-action "root-up"))
(action
(name "base-down")
(hitbox 20 9 16 80)
(flip-action "base-up"))

(action
(name "root-left")
(hitbox 7 22 80 16)
(images "root_attack_left.png"))
(action
(name "base-left")
(hitbox 7 22 80 16)
(images "root_base_left.png"))

(action
(name "root-right")
(hitbox 9 22 80 16)
(mirror-action "root-left"))
(action
(name "base-right")
(hitbox 9 22 80 16)
(mirror-action "base-left"))
)
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.
96 changes: 96 additions & 0 deletions data/images/creatures/mole/corrupted/root_sapling.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
(supertux-sprite
(action
(name "idle")
(hitbox 24 22 32 32)
(fps 8)
(images "root_sapling-0.png"
"root_sapling-1.png"
"root_sapling-2.png"
"root_sapling-3.png"
"root_sapling-4.png"
"root_sapling-5.png"
"root_sapling-6.png"
"root_sapling-7.png"
"root_sapling-8.png"
"root_sapling-9.png"
"root_sapling-10.png"
"root_sapling-11.png"
)
)
(action
(name "idle-up")
(fps 8)
(hitbox 24 22 32 32)
(clone-action "idle")
)
(action
(name "squished-up")
(fps 15)
(loops 1)
(hitbox 24 22 32 32)
(images "corrupted_hill-0.png"
"corrupted_hill-1.png"
"corrupted_hill-2.png"
"corrupted_hill-3.png"
"corrupted_hill-3.png"
"corrupted_hill-4.png"
)
)
(action
(name "idle-down")
(fps 8)
(hitbox 24 70 32 32)
(flip-action "idle-up")
)
(action
(name "squished-down")
(fps 15)
(loops 1)
(hitbox 24 70 32 32)
(flip-action "squished-up")
)
(action
(name "idle-left")
(hitbox 18 24 32 32)
(fps 8)
(images "root_sapling-0_left.png"
"root_sapling-1_left.png"
"root_sapling-2_left.png"
"root_sapling-3_left.png"
"root_sapling-4_left.png"
"root_sapling-5_left.png"
"root_sapling-6_left.png"
"root_sapling-7_left.png"
"root_sapling-8_left.png"
"root_sapling-9_left.png"
"root_sapling-10_left.png"
"root_sapling-11_left.png"
)
)
(action
(name "squished-left")
(fps 15)
(loops 1)
(hitbox 18 24 32 32)
(images "corrupted_hill-0_left.png"
"corrupted_hill-1_left.png"
"corrupted_hill-2_left.png"
"corrupted_hill-3_left.png"
"corrupted_hill-3_left.png"
"corrupted_hill-4_left.png"
)
)
(action
(name "idle-right")
(hitbox 70 24 32 32)
(fps 8)
(mirror-action "idle-left")
)
(action
(name "squished-right")
(fps 15)
(loops 1)
(hitbox 70 24 32 32)
(mirror-action "squished-left")
)
)
Binary file modified data/images/creatures/mole/down-0.png
Binary file modified data/images/creatures/mole/down-1.png
Binary file modified data/images/creatures/mole/down-2.png
11 changes: 6 additions & 5 deletions data/images/creatures/mole/mole.sprite
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
(supertux-sprite
(action
(name "idle")
(hitbox 18 22 32 40)
(hitbox 26 22 32 64)
(fps 12)
(images "mole_hill.png"
)
)
(action
(name "peeking")
(hitbox 18 22 32 40)
(hitbox 26 22 32 40)
(fps 12)
(images "mole_hill.png"
"up-0.png"
Expand Down Expand Up @@ -44,7 +44,7 @@
)
(action
(name "burning")
(hitbox 18 22 32 40)
(hitbox 26 22 32 64)
(fps 15)
(loops 1)
(images "mole_hill.png"
Expand All @@ -54,8 +54,9 @@
(name "squished")
(fps 12)
(loops 1)
(hitbox 18 22 32 40)
(images "down-0.png"
(hitbox 26 22 32 64)
(images "up-3.png"
"down-0.png"
"down-1.png"
"down-2.png"
"mole_hill.png"
Expand Down
Binary file modified data/images/creatures/mole/mole_hill.png
Binary file modified data/images/creatures/mole/mole_rock-0.png
Binary file modified data/images/creatures/mole/mole_rock-1.png
Binary file added data/images/creatures/mole/mole_rock-2.png
16 changes: 12 additions & 4 deletions data/images/creatures/mole/mole_rock.sprite
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
(supertux-sprite
(action
(name "medium")
(hitbox 0 0 13 12)
(name "variant-1")
(hitbox 5 6 15 15)
(images
"mole_rock-0.png"
)
)

(action
(name "small")
(hitbox 0 0 10 10)
(name "variant-2")
(hitbox 5 6 15 15)
(images
"mole_rock-1.png"
)
)

(action
(name "variant-3")
(hitbox 8 8 11 11)
(images
"mole_rock-2.png"
)
)
)
Binary file modified data/images/creatures/mole/peek_left-0.png
Binary file modified data/images/creatures/mole/peek_left-1.png
Binary file modified data/images/creatures/mole/peek_left-2.png
Binary file modified data/images/creatures/mole/peek_right-0.png
Binary file modified data/images/creatures/mole/peek_right-1.png
Binary file modified data/images/creatures/mole/peek_right-2.png
Binary file modified data/images/creatures/mole/up-0.png
Binary file modified data/images/creatures/mole/up-1.png
Binary file modified data/images/creatures/mole/up-2.png
Binary file modified data/images/creatures/mole/up-3.png
5 changes: 4 additions & 1 deletion data/images/engine/editor/objects.stoi
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@
(object
(class "darttrap")
(icon "images/creatures/darttrap/granito/empty_left.png"))
(object
(object
(class "root_sapling")
(icon "images/creatures/mole/corrupted/root_sapling-0.png"))
(object
(class "ghoul")
(icon "images/creatures/ghoul/g1.png"))
(object
Expand Down
Binary file added data/images/particles/corrupted_rock-0.png
Binary file added data/images/particles/corrupted_rock-1.png
Binary file added data/images/particles/corrupted_rock-2.png
Binary file added data/images/particles/corrupted_rock-3.png
Binary file added data/images/particles/corrupted_rock-4.png
41 changes: 41 additions & 0 deletions data/images/particles/corrupted_rock.sprite
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(supertux-sprite
(action
(name "piece-0")
(hitbox 0 0 8 8)
(images
"corrupted_rock-0.png"
)
)

(action
(name "piece-1")
(hitbox 0 0 10 10)
(images
"corrupted_rock-1.png"
)
)

(action
(name "piece-2")
(hitbox 0 0 16 16)
(images
"corrupted_rock-2.png"
)
)

(action
(name "piece-3")
(hitbox 0 0 8 8)
(images
"corrupted_rock-3.png"
)
)

(action
(name "piece-4")
(hitbox 0 0 10 10)
(images
"corrupted_rock-4.png"
)
)
)
7 changes: 4 additions & 3 deletions src/badguy/ghosttree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@
#include "supertux/sector.hpp"

static const size_t WILLOWISP_COUNT = 10;
static const float ROOT_TOP_OFFSET = 64;
static const float WILLOWISP_TOP_OFFSET = -64;
static const Vector SUCK_TARGET_OFFSET = Vector(-16,-16);
static const float SUCK_TARGET_SPREAD = 8;
static const float ROOT_HEIGHT = 87;

GhostTree::GhostTree(const ReaderMapping& mapping) :
BadGuy(mapping, "images/creatures/ghosttree/ghosttree.sprite", LAYER_OBJECTS - 10),
Expand Down Expand Up @@ -154,12 +152,15 @@ GhostTree::active_update(float /*dt_sec*/)
}
}

// TODO: Add support for the new root implementation
/*
if (root_timer.check()) {
/* TODO: indicate root with an animation. */
//TODO: indicate root with an animation.
auto player = get_nearest_player();
if (player)
Sector::get().add<Root>(Vector(player->get_bbox().get_left(), (m_flip == NO_FLIP ? (m_col.m_bbox.get_bottom() + ROOT_TOP_OFFSET) : (m_col.m_bbox.get_top() - ROOT_TOP_OFFSET - ROOT_HEIGHT))), m_flip);
}
*/
} else if (mystate == STATE_SWALLOWING) {
if (suck_lantern) {
// Suck in the lantern.
Expand Down
7 changes: 6 additions & 1 deletion src/badguy/mole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "badguy/mole_rock.hpp"
#include "math/random.hpp"
#include "math/util.hpp"
#include "object/player.hpp"
#include "sprite/sprite.hpp"
#include "supertux/flip_level_transformer.hpp"
#include "supertux/sector.hpp"
Expand Down Expand Up @@ -64,9 +65,13 @@ Mole::collision_badguy(BadGuy& , const CollisionHit& )
}

bool
Mole::collision_squished(GameObject& )
Mole::collision_squished(GameObject& obj)
{
set_state(DEAD);

if (auto player = dynamic_cast<Player*>(&obj))
player->bounce(*this);

SoundManager::current()->play("sounds/squish.wav", get_pos());
run_dead_script();
return true;
Expand Down
4 changes: 2 additions & 2 deletions src/badguy/mole_rock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ MoleRock::initialize()
{
m_physic.set_velocity(initial_velocity);

// Randomly select a rock size to display.
set_action(graphicsRandom.rand(2) == 0 ? "small" : "medium");
int num = graphicsRandom.rand(1, static_cast<int>(m_sprite->get_actions_count()) + 1);
set_action("variant-" + std::to_string(num));
}

void
Expand Down
Loading
Loading