Jump to content


gold mammoth

Member Since 10 Aug 2008
Offline Last Active Feb 19 2013 09:18 PM

Posts I've Made

In Topic: Randomly choose a sound when player touches coin,

29 September 2012 - 01:35 AM

Do you mean when you collect a coin it plays sound1, then the next time you collect a coin it plays sound2, and then the next time you collect a coin it plays sound3, then it goes back playing sound1 the next time, repeating like that? So there is 1 coin object, but it just changes the sound in a order.

If that is what you want, try this:

CREATION CODE obj_player:
current_snd = 0; //This is what coin sound should be played the next time you collect a coin. Leave this value at 0.
coin_sound[0] = snd_coin; //This stores the value of the first coin sound. Remember that array values start at 0 and not 1.
coin_sound[1] = snd_coin2; //This stores the value of the second coin sound.
coin_sound[2] = snd_coin3; //This stores the value of the third coin sound.

COLLISION EVENT (with coin) obj_player:
sound_play(coin_sound[current_snd]); //This plays the current coin sound. 
current_snd += 1; //This changes the coin sound the next time a coin is collected.
if current_snd > 2 {current_snd = 0;} //Once the current_snd is at the third sound, it will start at the first sound again!

Let me know if this helps! :)

In Topic: Question: Is Isometric more difficult?

28 September 2012 - 04:34 AM

I recommend programming it in 2D, and just drawing it isometrically (it makes programming it a LOT easier). I'm also making an isometric game and that's how I'm programming it for the most part.


EDIT:
Didn't realize this thread was made in April... Posted Image

In Topic: Randomly choose a sound when player touches coin,

28 September 2012 - 04:10 AM

Add this to the collision event of the player object (collision with the coin object):

sound_play(choose(snd_coin,snd_coin2,snd_coin3));


Here's a quote from the manual about the choose function:

choose(val1,val2,val3,...) Returns one of the arguments choosen  randomly. The function can have up to 16 arguments.