New to puzzlescript/programming - need help with raising object mechanic

66 views
Skip to first unread message

Jacob Horton

unread,
Oct 30, 2021, 9:38:41 PM10/30/21
to PuzzleScript
Hello! I'm currently trying to make a game that's almost like a mix between bejewlled and bubble bobble, where the player is walking along the bottom of the board while sending bubbles to float to the top, match with 2 or more of the same color, then all disappear.
so far I've only been able to manage keeping the player at the ground level using 

vertical [ > player ] -> [ player ] 
vertical [ > player | crate ]  ->  [ >player | >crate ] 
vertical [ > crate |   ]   ->   [    |  > crate ] 

however when i run this, my object instantly goes beyond the wall to the very border of the screen. How can I make my object stop at the wall, and also slow it down so there's a bit of time before the object collides with the next object/wall?

Stephen Lavelle

unread,
Oct 31, 2021, 4:23:08 AM10/31/21
to Jacob Horton, PuzzleScript
hi,

Looking at your code, it's not obvious to me why crates would ever move - the first line removes vertical movement from the player, so the second line can never do anything?

One other problem is in the third line, you're copying the object without seeing if there's something blocking your path.  If you want to stop the crate overwriting walls and other crates you can do something like

vertical [ > crate | no crate no wall ] -> [ | > crate ]

That wont' animate it, though.  There's a possibly-related discussion here:

https://groups.google.com/g/puzzlescript/c/Wj_FMLkpm3Y has some possibly related discussions that might be useful.

If you want to search through the group, the keywords are probably "ice" or "slide" or the like :)

Best,

S

--
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 on the web, visit https://groups.google.com/d/msgid/puzzlescript/758c5871-6245-4ace-b9d8-31772e3c144en%40googlegroups.com.

That Scar

unread,
Oct 31, 2021, 1:27:16 PM10/31/21
to PuzzleScript
Note that all rules are executed in the order they are read (unless you have "late" rules mixed in but that's completely different)
So you might want to put your first line at the end instead of at the beginning.
Otherwise, like Stephen said, looking at other games and discussions can help a lot.

Reply all
Reply to author
Forward
0 new messages