Jump to content


Tapey

Member Since 16 Aug 2008
Offline Last Active Feb 05 2013 12:54 AM

Topics I've Started

Questions about using .wav files in a game

20 June 2012 - 10:54 PM

Just a little question here, but I was wondering if using a couple of .wav files in a simple arena shooter would make much difference to how the game runs/loads at all on the average computer/laptop? Here's some information on the two .wav files I was going to use:

1) The first .wav file is 21.8mb large, and was going to be used as background music on the title screen, looping until the player progresses to gameplay.

2) The second .wav file is 27.4mb large, and was going to be used as background music during gameplay. It was going to be set to play on loop in the create event of the player, until they die at which point the music will end.

I'm aware that using mp3s would keep the file size down, but I've always run into problems with using external .dlls to run mp3 files with games in the past, causing bizarre problems throughout playtesting (randomly being unable to initialize or some such) and having similar issues for players, despite everything being done correctly and confirmed to have been multiple times. So I've opted to use .wav files which are larger filesizes, but have zero risk when it comes to errors and problems with things not working correctly.

I was just wondering though, is there much to worry about with the two .wav files with the sizes I've described? Like mentioned previously, the game will just be a simple arena shooter, which if I had to guess, will probably be around 55mb in size once completed (taking into account the size of the .wav files).

I was also curious, but how will GameMaker load these .wav files? Will they both be loaded when the game starts up, so that they can play instantly without having to load at all once playing the game? Or will the game load them up each time they're needed, which could cause a couple seconds delay perhaps? I'd rather have all resources loaded when the game starts up since that seems to be the best option. I assume that ticking the "preload" option for each .wav sound file will do that?

Thanks for reading and any information/advice would be greatly appreciated :)

Setting the speed/sensitivity of mouse

04 June 2012 - 06:43 AM

Hi, I'm making a game where the player object is controlled with the mouse (the x and y are mapped to mouse_x and mouse_y in the step event) and I was wondering if there's a way to set the maximum speed at which the mouse can move the object around the screen?

Choosing where to create an object?

29 January 2012 - 03:44 AM

I have an object in my game that has the job of spawning items for the player to collect around the level. I want this object to only spawn one object at a time, and when it does so, I want it to randomly choose from a specific set of x and y coordinates. Here's the code I tried to use, which unfortunately spawns the objects in all locations at once. I was trying to use a global variable to ensure only one object was ever available for collection but it didn't seem to work, so if anybody could also modify this code so that it only creates an object if no instances of it already exist, I'd be very grateful. I have this in an alarm event:

if global.cancollect=0
{
choose(instance_create(128,400,objCollect),instance_create(1152,400,objCollect),instance_create(640,640,objCollect),instance_create(640,128,objCollect))
global.cancollect=1
}

In the objCollect collision event with the player, it sets global.cancollect to zero to allow a new objCollect to spawn once it's been collected, but this doesn't seem to work. Any help would be much appreciated.

Creating an object anywhere in the room

25 January 2012 - 01:29 AM

I have a controller object that randomly spawns other objects inside a room. I currently have it set so it spawns at random(room_width) and random(room_height). How would I set it so that it still spawns objects randomly but avoids spawning anything within say... a 100 pixel radius of objPlayer? Any help would be much appreciated, thanks!

How to create a single object

24 January 2012 - 11:45 PM

I was wondering if anybody knows of the best way to create a single object when two identical objects collide? Obviously doing destroy upon collision and then creating a new object in the destroy event results in two new objects rather than a single one, so I was wondering if anybody knows the best way to deal with this, and creating the new object where the two previous ones collided. I have a feeling I might be missing something simple and obvious here, so apologies if it's a dumb question. Any help would be appreciated regardless, thank you!