Skip to content

Conversation

@wjt
Copy link
Member

@wjt wjt commented Nov 28, 2025

This adds a new section to the right-hand side of the main scene, with
golden coins that can only be collected by using special abilities:

  • You must teleport to be able to get into the area at all. (Even if you
    enable double-jump, you can't jump over the central dividing wall -
    you would have to massively increase the jump height or enable
    infinite double-jumping to get over it!)

  • You must become small to get into a narrow cave and collect the coin
    within. I have tried to lay the level out to make it very difficult to
    teleport onto the coin.

  • Another coin is in a cave, guarded by an enemy. The cave is not high
    enough to stomp on the enemy (and to make sure I made it
    non-stompable). So you must phase through it, unphase to pick up the
    coin, and then phase back out. (Actually I think you could probably
    jump over the guard in small mode if you tried hard enough!) I have
    tried to make it impossible to teleport onto the coin but if you can
    pull that off, you deserve it.

  • Finally there is a run of coins high in the air that are best reached
    by gliding. You can get these by teleporting or double-jumping but
    it's easiest by gliding.

I had to add a new special_coin scene to avoid these coins being counted towards the goal. The idea is that all these coins are optional, but they're there to entice you to explore the game.

Depends on:

wjt added 6 commits November 28, 2025 22:56
Previously, game_logic.gd walked recursively over all nodes in the tree,
counting those which are an instance of the Coin script.

A more idiomatic way to do this is to place coins into a group, and then
count how many nodes are in that group. This will also make it easier to
have some coins that don't count towards the goal, by having those coins
not be in this group.
The bug this was taking advantage of was fixed in Godot 4.4. The
property is displayed with a spin control despite this hack.

Godot 4.6 will add a new "prefer_slider" hint
<https://github.com/godotengine/godot/pull/1104599>.

Remove the weird 0.9-coin step, and replace the HACK comment with a TODO
for when we update to Godot 4.6.
This scene is identical to coin.tscn except that it is not in the
"coins" group. This will be used to add extra coins to the scene that
can't be collected with the default game setup: you have to give the
player additional abilities.

Annoyingly if scene A is in a group, then you can't remove instances of
A from that group; you also can't make an inherited scene B that
inherits from A and remove B from the group.

We could do it the other way round: have a basic coin which is not in
the group, and then make coin.tscn inherit from it just to set the
group. But that seems very strange.

Or we could not put coin.tscn into the group, and force the level
designer to add every non-special coin to the group by hand. This seems
error-prone.

Duplicating the scene seems the least-bad option; it's a very simple
scene, and the (simple) script is shared.
This matches how coins and platforms are grouped and helps organise the
scene a bit.
This adds a new section to the right-hand side of the main scene, with
golden coins that can only be collected by using special abilities:

- You must teleport to be able to get into the area at all. (Even if you
  enable double-jump, you can't jump over the central dividing wall -
  you would have to massively increase the jump height or enable
  infinite double-jumping to get over it!)

- You must become small to get into a narrow cave and collect the coin
  within. I have tried to lay the level out to make it very difficult to
  teleport onto the coin.

- Another coin is in a cave, guarded by an enemy. The cave is not high
  enough to stomp on the enemy (and to make sure I made it
  non-stompable). So you must phase through it, unphase to pick up the
  coin, and then phase back out. (Actually I think you could probably
  jump over the guard in small mode if you tried hard enough!) I have
  tried to make it impossible to teleport onto the coin but if you can
  pull that off, you deserve it.

- Finally there is a run of coins high in the air that are best reached
  by gliding. You can get these by teleporting or double-jumping but
  it's easiest by gliding.
@github-actions
Copy link

Play this branch at https://endlessm.github.io/moddable-platformer/branches/endlessm/specials-area.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq
Copy link
Contributor

manuq commented Nov 28, 2025

I love the idea of the secret place. Great one, @jgbourque @wjt

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.

3 participants