Game Development Community

I broke Torque!!

by 2dGamer · in Torque 2D Beginner · 02/08/2014 (9:12 am) · 2 replies

$minBet = 0.25;
$maxBet = 10;
$bet = minBet;

changeBet($minBet,add);

function changeBet(%amount , %change){
	switch$(%change){
		case "add" :
		%tempAmount = %amount + $bet; //this was put here for debugging purposes
		    if(!%tempAmount > $maxBet){
			$bet += %amount;
			}
		case "sub" :
		if(!($bet - %amount) < $minBet){
			$bet -= %amount;
			}
	}
}

When I increase the bet it does nothing...

#1
02/08/2014 (9:13 am)
!(%tempAmount > $maxBet) Fixed stuff..... gah...this is what I get for doing this right after I woke up...
#2
02/09/2014 (5:16 am)
If you change it to if (%tempAmount < $maxBet), you can drop the !.