Q
Quelandoris
Guest
So I'm trying to make a rhythm game, and for this I need my obstacle objects(Whose only code is y-=4) to spawn at particular times in the song. I have a devoted object that keeps track of when it needs to create these obstacles.
Right now its code is as follows:
Create:
Step:
So some explanation:
The "off" variable is the offset between when an object spawns and when it will reach the player. The variable is there mostly to make it easier for me to set my game to the music.
The "high_ob" is one kind of obstacle.
After using show_debug_message, The game never gets into the if statement at all.
Any help would be appreciated, thank you in advance!
Right now its code is as follows:
Create:
Code:
///Play music
//set sound
audio_play_sound(song,100,false);
//Set sound offset
off = ((room_width-player_ob.x)/4)/room_speed;
Code:
///Spawn objects at correct times
//At 5 seconds in
if(audio_sound_get_track_position(song)==5-off){
instance_create(1025,130,high_ob);
}
The "off" variable is the offset between when an object spawns and when it will reach the player. The variable is there mostly to make it easier for me to set my game to the music.
The "high_ob" is one kind of obstacle.
After using show_debug_message, The game never gets into the if statement at all.
Any help would be appreciated, thank you in advance!