Jump to content
MakeWebGames

Atmospheric sounds for your game includes Attacking/mailbox/events and ingame music


Uridium

Recommended Posts

Ok cant say ive seen this in a game yet but thought it might be fun to have.

The attack system is boring to say the least so why not have background sounds when you hit someone or when they hit you.

And a mailbox / events that makes a sound when you have received them or even just add background sounds to your game in general.

Well ive been up all night making this addition and have finally made it happen.

Dont worry about sounds getting on your Users nerves cos they can be turned on and off. either all sounds or just sounds selected by the user..

snd.png

Attack Sounds as you can see above can be turned off.

All files are done via SWF and only last a few seconds. You can add as many SWF files as you wish for example YOUHIT so users dont always get the same sounds..

*** UPDATE***

the use of SWF has been widened to any media format..

 

See post: 

 

Link to comment
Share on other sites

Im just going to add one sound for each for now cos this is taking ages and once i get chance i'll add more sounds for attacking as i go along...

will be about an hour before the scripts up.

the easy Part...

on your FTP create a folder called sndfiles and in that folder create three more attacking, atmospheric, mainpage

in the newly created attacking folder create 4 new folders youhit, youfail, theyhit, theyfail,

Dont forget to put a blank index.php or index.html file in each folder

Link to comment
Share on other sites

SQLS

[mysql]CREATE TABLE IF NOT EXISTS `sounds` (

`soundid` int(11) NOT NULL auto_increment,

`userid` int(11) NOT NULL default '0',

`mainsnd` int(2) NOT NULL default '0',

`youhitsnd` int(2) NOT NULL default '0',

`youfailsnd` int(2) NOT NULL default '0',

`theyhitsnd` int(2) NOT NULL default '0',

`theyfailsnd` int(2) NOT NULL default '0',

`mailboxsnd` int(2) NOT NULL default '0',

`eventssnd` int(2) NOT NULL default '0',

PRIMARY KEY (`soundid`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

[/mysql]

and two for the users table

ALTER TABLE `users` ADD `mainsnd` TINYINT( 2 ) NOT NULL DEFAULT '0'

ALTER TABLE `users` ADD `firsttime` TINYINT( 2 ) NOT NULL DEFAULT '0'

now open up preferences.php and where the cases are add

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and on the links section add this...

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

now for the functions add

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Thats it for the preferences.php file now open up header.php

and underneath the very first mention of global add

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

And thats it for the header.php

Now create a new file called mainpage.php and make sure WORDWRAP is OFF this is vital as the next part will call for one line at a time so if yours exceeds online and goes onto 2 then it will think the 2nd line is another track...

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

and then create a file called changetrack.php

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

PART 2 Below

Link to comment
Share on other sites

Morning Bert

You dont have to use a flash file now.. as it has been redone and will accept any media type..

I started using SWF small files because of the problem with restarting when a link was clicked but now the problem has been resolved its able to play full lengh tracks without disturbing the players actions when clicking links..

Link to comment
Share on other sites

  • 7 months later...
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...