Icedmetal57
Member
Well I've been trying to make a script that plays a certain Background Sound when the player is within range of a tile that has a certain terrain tag. Can someone help me out with this ranged business? I have managed to do it one way, but isn't that great and the sound will start all over again when you walk away and then come back. I want it to just constantly play then when you get near it again it'll be louder.
Wow, I just realized what I had typed and just realized how I could do that, but I'd still like to do it a better way for the range. Currently I'm doing it this way.
Now I know there is a better way of doing this, but that's what I need help with getting.
Oh also when I have it this way, the volume was only set at one number, I'd like to make it vary based on your location, thus the need for the in_range? type method.
Wow, I just realized what I had typed and just realized how I could do that, but I'd still like to do it a better way for the range. Currently I'm doing it this way.
Code:
x1 = $game_player.x - 10
x2 = $game_player.x + 10
y1 = $game_player.y - 10
y2 = $game_player.y + 10
for x in x1...x2
for y in y1...y2
if $game_map.terrain_tag(x, y) == 1
terrain = 0
range_bgs = true
elsif $game_map.terrain_tag(x, y) == 2
terrain = 1
range_bgs = true
else
range_bgs = false
end
end
end
Oh also when I have it this way, the volume was only set at one number, I'd like to make it vary based on your location, thus the need for the in_range? type method.