function eventFunction(params) {
var length:Float = Std.parseFloat(params[1]);
var portrait:String = 'Gold';
switch (PlayState.dadOpponent.curCharacter.toLowerCase()) {
case 'gold-headless':
var i = math.round(math.random(1, 3))
switch (i) {
case (i == 1):
portrait = 'GoldAlt';
break;
case (i == 2):
portrait = 'GoldAlt2';
break;
case (i == 3):
portrait = 'GoldAlt3';
break;
}
}
heres the code. i have 3 images set up and when i remove the switch thing an image does show up, but when i want 3 random different images for the game to pick from then nothing shows up. sry if this is stupid but im really bad at javascript
Aucun commentaire:
Enregistrer un commentaire