Better Logic [v1.1]

MrD69

  • Posts: 235
Stencyl-Better-Logic
Extension for the Stencylworks game engine that adds better logic blocks such as switch case statements and ternary operator

Stencyl currnetly lack some functionality with logic operators such as switch statements which is why I made this extension to help you devlope better games!

Download Here: https://github.com/ess4654/Stencyl-Better-Logic

Example




Switch


Sets the value to be measured using case blocks. All case blocks must reside within the switch statement.

Case


If the value of case matches the valued passed into switch, the code within case will be executed.

Default


Code within this block will be executed if none of the cases match the value of the switch.

Addition Blocks ++


Adds 1 to a number.

Subtraction Blocks ++


Subtracts 1 from a number.

Ternary


Useful shortcut for setting values that is faster then an if else statement. If the boolean value is true, the first value is returned otherwise the last value will be returned.

Last Updated April 2, 2020 v1.1

-------------------------------------------------------------------------------------------------------------------------
Additional Notes:

Contact Me: thejoblesscoder@gmail.com

Extension is Open Sourced and Licensed under MIT open source standards.

« Last Edit: April 02, 2020, 07:00:17 pm by MrD69 »
Games: Arrow Mania, Breakout/Outbreak, Water Drop


Rocktapus

  • Posts: 28
These extensions are great. Thanks for sharing :)


irock

  • *
  • Posts: 2891
Nice work! Gonna check it out soon.

I'd recommend adding a prefixed ++ and -- for "normal blocks" as well.
Code: [Select]
// Post-fix:
var i = 0;
trace(i++); // 0
trace(i); // 1

// Pre-fix
var i = 0;
trace(++i); // 1
trace(i); // 1