Need help for first game

62 views
Skip to first unread message

Luke Vader

unread,
May 24, 2026, 4:31:39 AM (7 days ago) May 24
to PuzzleScript

The whole mechanic behind this game is that there are two movement modes the player can switch between: tame and mad.

Tame mode works exactly like regular sokoban. The player can move freely and pushes blocks 1 tile ahead. 

Mad mode makes it so that the player charges in the direction you press, only stopping when they hit a solid surface. Afterwards, they return back to tame mode. Hitting blocks in this state causes them to be launched in the direction you were facing, as if they were sliding on ice.

Here's the problem though; the player can't turn mad when right next to a solid surface like a wall or crate. This is a really big issue as it shuts down a lot of opportunity for interesting puzzles.

Additionally, the brown line on top of the player at the start is supposed to be the top of their hat, since the whole sprite couldn't fit within the 5x5 aspect ratio. It moves with them (which is supposed to happen), but disconnects whenever they charge or try to move while up against a solid surface. I want it to stay attached to the player sprite regardless.

Stephen Lavelle

unread,
May 24, 2026, 4:43:06 AM (7 days ago) May 24
to Luke Vader, PuzzleScript
Let me answer some of your questions:

>Additionally, the brown line on top of the player at the start is supposed to be the top of their hat, since the whole sprite couldn't fit within the 5x5 aspect ratio. It moves with them (which is supposed to happen), but disconnects whenever they charge or try to move while up against a solid surface. I want it to stay attached to the player sprite regardless.

delete it and recreate it in the 'late' phase of each turn

late [ player_hat ] -> [ ]
late down [ | player ] -> [ player_hat | player ]

also in the prelude you want norepeat_action


--
You received this message because you are subscribed to the Google Groups "PuzzleScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puzzlescript...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/puzzlescript/461f8b4e-8625-4614-8ef2-9774046b41dbn%40googlegroups.com.

Luke Vader

unread,
May 24, 2026, 7:09:13 PM (6 days ago) May 24
to PuzzleScript
Thanks, now time for the bigger issue: the player being unable to get mad when right next to an obstacle.

This is the code for how getting mad works:
[ Action Bruno] -> [BrunoMad]

[ Playermad | Charge ] -> [ > Playermad | ]
[ > Playermad | no Solid | ] -> [ > Playermad | | Charge ] again
[ Charge Solid ] -> [ Solid ]
[ BrunoMad | Solid] -> [ Bruno | Solid]

The player is supposed to immediately revert back to their 'tame' state after colliding into something when 'mad'. However, with how the code's written, it makes so they can't get mad whenever they're right next to an obstacle. Another problem that arises from this code is that the player immediately reverts back to their 'tame' state when passing by a solid object instead of colliding with it. Also, one odd thing I noticed is that when the player's charge is cut off by this, they'll continue their streak when the action button is pushed again but haven't made any movements beforehand. Try it out in this updated test version and you'll see what I mean.

Sinan Huzaifa

unread,
May 25, 2026, 4:30:45 AM (6 days ago) May 25
to PuzzleScript

The issue is that [ Action Bruno] -> [BrunoMad] only triggers when the player isn't adjacent to a solid because the collision rule for [ Bruno | Solid] takes priority. You need to force the mad state change before the movement rule checks for solids. Try moving the mad transition to the pre or late phase instead of handling it as a direct action rule. That should decouple it from adjacency checks.

Sévan Kazandjian

unread,
May 25, 2026, 7:20:07 AM (5 days ago) May 25
to PuzzleScript
I couldn't make it work with only adding "late" keywords so I thought I'd dip in a bit:

[ BrunoMad | Solid] -> [ Bruno | Solid] is omnidirectional so Bruno will soothe when being adjacent to *any* solid. Hence your problem.
You'd need to specify somehow that you want him to calm down if he is walking *toward* the solid.

Since you already have the Charge set up you could replace / combine
[ Charge Solid ] -> [ Solid ]
[ BrunoMad | Solid] -> [ Bruno | Solid]

with 
late [ BrunoMad | Charge Solid] -> [ Bruno | Solid]

the "late" keyword makes it so this rule is checked after the movement phase.

It seems to be working in my case though it's not devoid of problem in some edge cases

Of note, for sliding behaviour people often decorrelates all directions LRUP as in :
https://www.puzzlescript.net/play.html?p=81b9430a6c09b355f6379c0f63beb04c
it's tedious but might be useful.

Of note 2, if you don't need animations, you could use simpler set-ups as in :

Have fun!
Sévan.

Luke Vader

unread,
May 25, 2026, 8:24:10 PM (5 days ago) May 25
to PuzzleScript
Also, forgot to mention that the box just sorta teleports after the player charges into it. It's supposed to slide tile-by-tile.

Luke Vader

unread,
May 25, 2026, 8:24:15 PM (5 days ago) May 25
to PuzzleScript
Thanks, but I've stumbled across another issue: the mad player pushes the box before they make contact with it. It also doesn't revert them back to their 'tame' state.

Try it out in this test and you'll see what I mean.

On Monday, May 25, 2026 at 4:20:07 AM UTC-7 Sévan Kazandjian wrote:
Reply all
Reply to author
Forward
0 new messages