A
Anti-Icarus
Guest
I'm working on a Tic-Tac-Toe game based on a chapter of The Game Maker's Apprentice. It's in the early stages in development and I've encountered a problem: there is no clicking sound for when I click on the designated game field within a 640x480 room.
Following the instructions of The Game Maker's Apprentice, I created an object utilizing scripts to define the play field.
So far, the scripts within the events of obj_field are working as evident in the screenshot below:
The only real problem I'm having so far is that there is no clicking sound for whenever I click in the designated play field. I've written the script (scr_field_click) from the textbook, so as it stands, it goes like this:
The problem I'm referring to is in the bottom part of the script when I click on the field to set the stone. While the script as it is would work exactly like it was supposed to in the older versions of GameMaker, that is not the case with GameMaker: Studio as it is just not playing any sound at all when I click on the designated field. Now how can I get it to actually play the clicking sound? Would changing the Global Mouse, Left Button event into another event work? Or would I have to alter the script a little bit so that the sound would be played?
Following the instructions of The Game Maker's Apprentice, I created an object utilizing scripts to define the play field.
So far, the scripts within the events of obj_field are working as evident in the screenshot below:
The only real problem I'm having so far is that there is no clicking sound for whenever I click in the designated play field. I've written the script (scr_field_click) from the textbook, so as it stands, it goes like this:
Code:
{
var i, j;
//Find the position that is clicked
i = floor((mouse_x - 208) / 140);
j = floor((mouse_y - 32) / 140);
//Check whether it exists and is empty
if (i < 0 || i > 2 || j < 0 || j > 2) exit;
if (field[i, j] != 0) exit;
//Set the stone
field[i, j] = 1;
sound_play(snd_place);
}