Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Please help! Terrain Tag!

In my game I will have terrain tag's and each will have a sound. I tried to set up an common event but when I played game it kept playing the noise even though i wasnt moving.

Please help. If you need more info on the problem then here you go.
The Common Event:

Conditional Branch: Variable [0003: Terrain Tag] = Player's Terrain Tag
>Control Variables: [0003: Terrain Tag]== 1
> Play SE: 'terrain_1.ogg', 80, 100
> Wait: 1 frame(s)
>
: Else
>Control Variables: [0003: Terrain Tag]== 2
> Play SE: 'terrain_2.ogg', 80, 100
> Wait: 1 frame(s)
>
: Else
>Control Variables: [0003: Terrain Tag]== 3
> Play SE: 'terrain_3.ogg',80, 100
> Wait: 1 frame(s)
>
: Else
>Control Variables: [0003: Terrain Tag]== 4
> Play SE: 'terrain_4.ogg',80, 100
> Wait: 1 frame(s)
>
:Else
>Control Variables: [0003: Terrain Tag]== 5
> Play SE: 'terrain_5.ogg',80, 100
> Wait: 1 frame(s)
>
:Else
>Control Variables: [0003: Terrain Tag]== 6
> Play SE: 'terrain_6.ogg',80, 100
> Wait: 1 frame(s)
>
: Branch End

I hope this helps!!!
 

Spoo

Sponsor

Maybe adding conditional branches for when the player is pressing the up, down, left, or right move key?

I don't know for sure; a script would be a much more efficient way to do this, IMO.
 
If you only want the sound to play only when the player is moving, use the following script in the Conditional Branch (last page):
$game_player.moving?

And copy-paste everything into that Branch. You may need to increase the wait time (>1 frame), or the sound might play multiple times.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top