-
Notifications
You must be signed in to change notification settings - Fork 20
More Sounds
noooway edited this page Mar 13, 2017
·
23 revisions
- More sounds.
Bricks:
local simple_break_sound = {
love.audio.newSource(
"sounds/simple_break/recordered_glass_norm.ogg",
"static"),
love.audio.newSource(
"sounds/simple_break/edgardedition_glass_hit_norm.ogg",
"static") }
local armored_hit_sound = {
love.audio.newSource(
"sounds/armored_hit/qubodupImpactMetal_short_norm.ogg",
"static"),
love.audio.newSource(
"sounds/armored_hit/cast_iron_clangs_14_short_norm.ogg",
"static"),
love.audio.newSource(
"sounds/armored_hit/cast_iron_clangs_22_short_norm.ogg",
"static") }
local armored_break_sound = {
love.audio.newSource(
"sounds/armored_break/armored_glass_break_short_norm.ogg",
"static"),
love.audio.newSource(
"sounds/armored_break/ngruber__breaking-glass_6_short_norm.ogg",
"static") }
local ball_heavyarmored_sound = {
love.audio.newSource(
"sounds/heavyarmored_hit/cast_iron_clangs_11_short_norm.ogg",
"static"),
love.audio.newSource(
"sounds/heavyarmored_hit/cast_iron_clangs_18_short_norm.ogg",
"static") }
Bonuses:
local bonus_collected_sound = {
love.audio.newSource("sounds/bonus/bonus1.wav", "static"),
love.audio.newSource("sounds/bonus/bonus2.wav", "static"),
love.audio.newSource("sounds/bonus/bonus3.wav", "static")
}
Ball-wall
local ball_wall_sound = love.audio.newSource(
"sounds/ball_wall/pumpkin_break_01_short_norm.ogg",
"static")
- Select and play one of the sounds:
Bricks.
local snd_rng = love.math.newRandomGenerator( os.time() )
function bricks.brick_hit_by_ball( i, brick, shift_ball, bonuses, score_display )
if bricks.is_simple( brick ) then
bonuses.generate_bonus(
vector( brick.position.x + brick.width / 2,
brick.position.y + brick.height / 2 ),
brick.bonustype )
score_display.add_score_for_simple_brick()
table.remove( bricks.current_level_bricks, i )
local snd = simple_break_sound[ snd_rng:random( #simple_break_sound ) ]
snd:play()
elseif bricks.is_armored( brick ) then
bricks.armored_to_scrathed( brick )
local snd = armored_hit_sound[ snd_rng:random( #armored_hit_sound ) ]
snd:play()
elseif bricks.is_scratched( brick ) then
bricks.scrathed_to_cracked( brick )
local snd = armored_hit_sound[ snd_rng:random( #armored_hit_sound ) ]
snd:play()
elseif bricks.is_cracked( brick ) then
bonuses.generate_bonus(
vector( brick.position.x + brick.width / 2,
brick.position.y + brick.height / 2 ),
brick.bonustype )
score_display.add_score_for_cracked_brick()
table.remove( bricks.current_level_bricks, i )
local snd = armored_break_sound[ snd_rng:random( #armored_break_sound ) ]
snd:play()
elseif bricks.is_heavyarmored( brick ) then
local snd =
ball_heavyarmored_sound[ snd_rng:random( #ball_heavyarmored_sound ) ]
snd:play()
end
end
Bonuses:
local snd_rng = love.math.newRandomGenerator( os.time() )
function bonuses.bonus_collected( i, bonus,
balls, platform,
walls, lives_display )
.....
table.remove( bonuses.current_level_bonuses, i )
local snd = bonus_collected_sound[ snd_rng:random( #bonus_collected_sound ) ]
snd:play()
end
Feedback is crucial to improve the tutorial!
Let me know if you have any questions, critique, suggestions or just any other ideas.
Chapter 1: Prototype
- The Ball, The Brick, The Platform
- Game Objects as Lua Tables
- Bricks and Walls
- Detecting Collisions
- Resolving Collisions
- Levels
Appendix A: Storing Levels as Strings
Appendix B: Optimized Collision Detection (draft)
Chapter 2: General Code Structure
- Splitting Code into Several Files
- Loading Levels from Files
- Straightforward Gamestates
- Advanced Gamestates
- Basic Tiles
- Different Brick Types
- Basic Sound
- Game Over
Appendix C: Stricter Modules (draft)
Appendix D-1: Intro to Classes (draft)
Appendix D-2: Chapter 2 Using Classes.
Chapter 3 (deprecated): Details
- Improved Ball Rebounds
- Ball Launch From Platform (Two Objects Moving Together)
- Mouse Controls
- Spawning Bonuses
- Bonus Effects
- Glue Bonus
- Add New Ball Bonus
- Life and Next Level Bonuses
- Random Bonuses
- Menu Buttons
- Wall Tiles
- Side Panel
- Score
- Fonts
- More Sounds
- Final Screen
- Packaging
Appendix D: GUI Layouts
Appendix E: Love-release and Love.js
Beyond Programming: