Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits) (+1)

I'm very glad you had a positive experience trying Decker. I enjoyed reading about the making of your game. For whatever it's worth I thought the lighting effects at the end of the tunnel were quite effective!

If you're interested, there are a few ways you can simplify the script in this post for future projects. Widgets have a ".toggle[]" function that serves as a shortcut for toggling their visibility between solid/transparent and none. It takes the "shown" style as a first argument and a true/false condition as its second argument. Since .toggle[] shows things when the condition is true, it's the reverse of your conditional, so I have to add a ! (not) operator:

on view do
 distractions.widgets.button5.toggle["solid" !distract.widgets.points.value<4]
end

In this case I think you could also write the condition as:

on view do
 distractions.widgets.button5.toggle["solid" distract.widgets.points.value>3]
end

Another trick for making scripts more readable is to define local "shorthands" for widgets- a name followed by a colon followed by the path to a part of the deck lets you use that short name instead of the whole path; especially handy if you need to refer to the same widget several times in the same script:

on view do
 button: distractions.widgets.button5
 points: distract.widgets.points
 button.toggle["solid" !points.value<4]
end

If you haven't seen it before, Phinxel's Phield Notes has a lot of very useful simple scripting examples and other Decker tips.

Sorry for the long comment, and best of luck on your future projects!

(+1)

That's so funny, I'd originally tried "toggle" but in the end preferred to set the value more definitively after I understood how that needed to be formatted to happen, thanks to a comment on the community boards clarifying the full documentation (which I prefer over Phinxel because I can search on the page and increase text size for readability). 

I'm not that interested, personally, in using shorthands at this time, partly because I end up scripting in full in one doc and bringing pieces over--treating it more like a script-script, maybe, or writing an address a bunch on mail.

Thanks for the feedback, I'll be sure to keep your suggestions in mind if anything I make next in Decker would benefit by them.

I'm glad the lighting effect was effective, thank you!