Jump to content


Photo

3d sound in 2d games [SOLVED]


  • Please log in to reply
2 replies to this topic

#1 GOLD MAKER

GOLD MAKER

    GMC Member

  • GMC Member
  • 23 posts
  • Version:GM8

Posted 17 June 2012 - 10:09 AM

HI, i am trying to make 3d sound works in 2d diminution relative to the center of the view but it just don't work well..if the center of the view is right of the view i don't hear any sound!

--can someone give me example how this works

PS: i have 2 speakers.
  • 0

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14397 posts
  • Version:GM:Studio

Posted 19 June 2012 - 03:23 AM

play the sound in a sound instance
use point_distance(x,y,view_x+view_wview/2,view_x+view_hview/2) as z parameter to sound_3d_set_sound_position in the step event. dont forget to set the min max value of the 3d sound

Sound Instance
//create
sound_3d_set_sound_distance(sound1,64,256) ;
sound_loop(sound1);

//step
sound_3d_set_sound_position(sound1,0,0,point_distance(x,y,view_x+view_wview/2,view_x+view_hview/2));


sound must be 3d sounds
sound must be .wav
  • 1

#3 GOLD MAKER

GOLD MAKER

    GMC Member

  • GMC Member
  • 23 posts
  • Version:GM8

Posted 19 June 2012 - 09:27 AM

thanks, +1 for u
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users