Skip to content
Yaojun Tan edited this page Sep 12, 2022 · 9 revisions

Introduction

Game sound effects and music allow players to integrate into the game world and resonate with their emotions. Sound effects don't stop there. If there is no superb game sound effects, no matter how good the graphics skills can not make the game performance out of mediocrity, it is not attractive enough to the players. Excellent game sound design will affect the performance quality and entertainment interactivity of a game, so game sound design is no longer a foil for the game screen, it is the best supplement to the game connotation and a powerful driving force for game culture.

Code

Music interface

Call 'playMusic' to add music or sound:

package com.deco2800.game.music;

import com.badlogic.gdx.audio.Music;
import com.deco2800.game.services.ServiceLocator;
import com.deco2800.game.services.ResourceService;

public class MusicStuff {
    public static void playMusic(String path, boolean loop) {
        Music music = ServiceLocator.getResourceService().getAsset(path, Music.class);
        music.setLooping(loop);
        music.setVolume(0.3f);
        music.play();
    }
}

Music list

Used to store all the music effects that need to be used

  private static final String backgroundMusic = "sounds/VillageBGM_2.mp3"; // Example
  private static final String movementMusic = "sounds/Movement_sound.mp3"; // Example
  private static final String[] forestMusic = {backgroundMusic, movementMusic};
  • Call 'VillageBGM_2.mp3' when game start and set it loop playback, so that when the game starts, the music can be automatically looped. (In ForestGameArea.java)

  • Call 'Movement_sound.mp3' when the move button is pressed, so that every time we move we can hear the movement sound. (In KeyboardPlayerInputComponent.java)

If we need to change the selected music, you only need to simply switch the music path.

Table of Contents

Home

Game Design

User survey

Sprint 4

Eviction Menu and Win/lose Logic: Polishing tasks (Team 7)

Button Sounds and Ending Menu improve (Team 3)

Sound effect and Fixing the clue bug (Team 6)

Improvement of Enemy and Attack (Team 1)

Add Features When The Player Get Attacked and Overall UI Improvement (Team 8)

Sprint 1

Achievement System (Team 2)

Player Eviction Menu (Team 7)

Countdown Clock (Team 4)

Music (Team3)

Map (Team6)

Sprint 2

Player Eviction Menu (Team 7)

Character Design & Animation (Team 1)

Music (Team 3)

Inventory System and Consumables Items (Team 8)

Scenario design

Achievement System(team 2)

Storyline (Team 5)

Countdown Clock (Team 4)

Sprint 3

Ending Menu (Team 3)

NPC interaction (Team 2)

Win/lose Condition (Based on Eviction Menu) (Team 7)

Player Profile (Team 4)

Game Logo (Team 8)

Clue storage (Team 6)

Enemy Design and Attack (Team 1)

Scenario design for village(Team5)

Game design
Entities and Components

Service Locator

Loading Resources

Logging

Unit Testing

Debug Terminal

Input Handling

UI

Animations

Audio

AI

Physics

Game Screens and Areas

Terrain

Concurrency & Threading

Settings

Troubleshooting

MacOS Setup Guide

Clone this wiki locally