Ruby Tutorial: 04. Conditional Branches

February 12, 2010 at 7:27 PM | Posted in Tutorial | Comments Off on Ruby Tutorial: 04. Conditional Branches
Tags: , ,

Conditional Branches are functions that require an expression to be true or false… or a variable to equal a certain value (Check Equations Tutorial for more information on having a variable for the condition.). This way you can program buttons and commands of your own. With conditional branches you can create the best games… without these conditional branches your game would just be a huge cinema. If you created a string ($vma) you could put:
if $vma == true
do something
You always have to put an end function at the end of a conditional branch… other wise you will come with a SyntaxError… and it will point to the last line of your script… I have done a bit of research over ruby while i was gone in the past few weeks…. I will update my materials soon. NOTE: If your string does not work… you may have to change it to a variable… ex. @vmp…


Blog at
Entries and comments feeds.

%d bloggers like this: