How to make a footstep when i walk
#1
Posted 12 October 2011 - 11:21 PM
#2
Posted 13 October 2011 - 08:56 AM
e.g:
CREATE:
play_sound = 1
STEP:
if play_sound = 1 {
alarm[0] = 30
play_sound = 0
//play sound
}
ALARM[0]:
play_sound = 1
#3
Posted 13 October 2011 - 01:05 PM
Actually, It's multiple step sounds, but I'll just try this for fun until I get a response.Set up a trigger and a alarm[] or self made timer.
e.g:
CREATE:
play_sound = 1
STEP:
if play_sound = 1 {
alarm[0] = 30
play_sound = 0
//play sound
}
ALARM[0]:
play_sound = 1
#4
Posted 13 October 2011 - 02:18 PM
Actually, It's multiple step sounds, but I'll just try this for fun until I get a response.Set up a trigger and a alarm[] or self made timer.
e.g:
CREATE:
play_sound = 1
STEP:
if play_sound = 1 {
alarm[0] = 30
play_sound = 0
//play sound
}
ALARM[0]:
play_sound = 1
Wait it's Not Working! D:
#5
Posted 13 October 2011 - 09:28 PM
To add onto filulilus's answer, try this. In your movement code, make an alarm activate after a second or so. Then -
Alarm[0]
if (point_distance(x,y,xprevious,yprevious) > 0)
{
sound_play(choose(footstep1,footstep2));
alarm[0] = 30;
}
#6
Posted 13 October 2011 - 09:57 PM
alarm[3]=8+min(30-(spd*15),50)
if spd<>0 then
{
if ftype=0 then {snd=global.sn_fs_tile}
if ftype=1 then {snd=global.sn_fs_wood}
if ftype=2 then {snd=global.sn_fs_metal}
if ftype=3 then {snd=global.sn_fs_grass}
sound_volume(snd,global.s_vol)
}
else
{
exit
}
sound_play(snd)^
-Basically alarm 3 is set to a value calculated from your speed value (or in my case "Spd") with a maximum frequency
-Then it checks if you are moving and sets var "Snd" on what type of footstep to play (ftype is derived from whatever you have to be standing on)
-You can then change the volume using a global volume variable.
-Then it plays the sound effect stored in "Snd"
Enjoy!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











