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.

Bumping into things (Pokemon Starter Kit Script Editing)

boon

Sponsor

In the Pokemon Starter kit, when you hit an unpassable tile it bumps - too much, repeating really fast like a machine gun. Is there a way to edit this?

The script for the bumping is here:

Code:
      if !check_event_trigger_touch(@x, @y+1)
        Audio.se_play("Audio/SE/bump.wav")
      end

Is there a way to basically input a waiting of about 1 second before it repeats the sound?
 

khmp

Sponsor

Code:
@time_reset = 0 if @time_reset.nil? 
if !check_event_trigger_touch(@x, @y+1)
  if @time_reset <= 0
    Audio.se_play("Audio/SE/bump.wav")
    # Reset the timer to something
    @time_reset = Graphics.frame_rate / 2
  else
    # decrement timer
    @time_reset -= 1
  end
else
  @time_reset = 0
end

Try that. I know its a lot longer than the original 3 line if statement but I think it will work although I haven't tested it.
 

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