changing of background colour as a game function

103 views
Skip to first unread message

Nicole Chee

unread,
Sep 11, 2020, 5:58:22 AM9/11/20
to PuzzleScript
just shooting my shot in the dark here,, but wondering if it's possible to have a function where the action key changes the colour of the entire background in the game? would like to make a colour based game, sort of like HUE, but documents don't mention anything of the sort... a lil sad. 

eager to hear any suggestions of how i may be able to achieve this, if possible! 

thanks for reading and stay safe out there!! 

Yusuf Ebrahim

unread,
Sep 11, 2020, 11:42:51 AM9/11/20
to PuzzleScript
Cool idea! Here's a suggestion that may be inelegant, but I think would work: You could have multiple types of background tiles (each being a different color tile, and on the lowest collision layer) and the action key switches between them. Something like this:

[Action bg0] -> [tempbg1]
[Action bg1] -> [tempbg2]
[Action bg2] -> [tempbg3]
[Action bg3] -> [tempbg0]
[tempbg1] -> [bg1]
[tempbg2] -> [bg2]
[tempbg3] -> [bg3]
[tempbg0] -> [bg0]

Good luck!

Stephen Lavelle

unread,
Sep 11, 2020, 1:17:34 PM9/11/20
to Nicole Chee, PuzzleScript
Right now you can't change the background of the entire page (and I don't think it would be a net positive to implement it as a feature), but Yusuf's suggestion should suffice if you just want the play-area to change color.

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/a249e402-8e35-40d4-be24-cfbdf51f045bn%40googlegroups.com.

Nicole Chee

unread,
Sep 14, 2020, 9:09:39 PM9/14/20
to PuzzleScript
Thank you so much Yusuf! :-)

I'll be sure to give that a go and share any updates on here. 

Have a good day!

Nicole Chee

unread,
Sep 14, 2020, 11:07:54 PM9/14/20
to PuzzleScript
Hey yusuf,

I've tried this by labelling, under Objects, "background1", "background2" and so on for the different colours, but i'm not sure if they're defined as background tiles apart from the original Background. 

Not sure if i've done this wrongly :-( and does adding "temp" in front of the background work for you? because on my end it changes the text from green to white.

Thank you in advance! :")


On Friday, September 11, 2020 at 11:42:51 PM UTC+8 yusu...@gmail.com wrote:

Chris Pickel

unread,
Sep 15, 2020, 12:05:36 AM9/15/20
to Nicole Chee, PuzzleScript
I made something basic along these lines:

Is that useful? You’re welcome to steal any code you’d like from it.

--
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.

Yusuf Ebrahim

unread,
Sep 15, 2020, 12:28:32 AM9/15/20
to PuzzleScript
I think in the legend you could say: Background = background1 or tempbackground1 or background2 or tempbackground 2 (for example) and this should allow them to be defined as background tiles.

The "temp" isn't a special keyword or anything, but instead "tempbackground1", "tempbackground2", etc., would be whole other objects that would need to be defined within the Objects section (they can look like anything since they likely wouldn't end up seen by players), and given collision layers. The only reason I suggested using the tempbackground objects was because if it was done like this (which is what I would intuitively try first)...

[Action bg0] -> [bg1]
[Action bg1] -> [bg2]
[Action bg2] -> [bg3]
[Action bg3] -> [bg0]

...it wouldn't work because, line by line, bg0 would just change to bg1, then the next line would immediately change it to bg2 after that, etc., and the backgrounds would all end up being bg0. The temp objects prevent this issue.

Good luck!

Yusuf Ebrahim

unread,
Sep 15, 2020, 12:31:49 AM9/15/20
to PuzzleScript
Nice one Chris, I think that way is smoother!

Nicole Chee

unread,
Sep 15, 2020, 9:52:59 AM9/15/20
to PuzzleScript
thank you so much chris!! this works perfectly for me :-) 

thanks for sharing your code with me

Nicole Chee

unread,
Sep 15, 2020, 12:33:44 PM9/15/20
to PuzzleScript
i see, thank you for helping though!! we learn new things everyday :-))
Reply all
Reply to author
Forward
0 new messages