Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

DragonRuby Game Toolkit

An intuitive 2D game engine. Fast, cross-platform, tiny, hot loaded. · By DragonRuby

소리 문제입니다!!(sound build ) help me

A topic by ColBaek created May 12, 2023 Views: 165 Replies: 1
Viewing posts 1 to 2
I studied Dragon Ruby for about 5 days and made a Tetris game and added sound. I put sound in and engine has sound but when I build it doesn't come out. What should I do? The platform is Windows. I am using windows operating system. Below is my audio source code.

def initialize args

@args = args

@next_piece = nil
@next_move = 30
@score = 0
@gameover = false
@grid_w = 10
@grid_h = 20
@grid = []
@rotation=nil
@isBGM=true
for x in 0..@grid_w-1 do
@grid[x] = []
for y in 0..@grid_h-1 do
@grid[x][y] = 0
end
end
@color_index = [
[ 0, 0, 0 ],
[ 255, 0, 0 ],
[ 0, 255, 0 ],
[ 0, 0, 255 ],
[ 255, 255, 0 ],
[ 255, 0, 255 ],
[ 0, 255, 255 ],
[ 127, 127, 127 ]
]
srand Time.now.to_i
select_next_piece
select_next_piece
@args.audio[:my_audio] = {
input: 'mygame/sounds/bgm.wav', # Filename
x: 0.0, y: 0.0, z: 0.0, # Relative position to the listener, x, y, z from -1.0 to 1.0
gain: 0.2, # Volume (0.0 to 1.0)
pitch: 1.0, # Pitch of the sound (1.0 = original pitch)
paused: false, # Set to true to pause the sound at the current playback position
looping: true, # Set to true to loop the sound/music until you stop it
}

end

해결됐습니다!!