Author Topic: 1945 Shooter Example...  (Read 3685 times)

Luposian

  • Guest
1945 Shooter Example...
« on: February 26, 2015, 08:34:43 PM »
I'd like to use this game as a foundation for another game idea.  However, I notice that the music stops after the game starts.  When I go into the code and "comment out" pausemusic(), the music continues into the game, but the game freezes up a few seconds later and when I fire off a shot, there is no sound.  Is EGSL incapable of playing more than one channel or is this simply a limitation of the code used in this particular game demo?

Luposian

  • Guest
Re: 1945 Shooter Example...
« Reply #1 on: February 28, 2015, 07:24:50 AM »
Okay... wrote up a little music test program and found out you can have more than one sound going at once.  It was two different musics, using both playmusic and playsound commands.  Two playmusic don't seem to work together, but playmusic and playsound work fine together.  Will try two playsound, since they do the same thing, but playmusic doesn't have a channel function, whereas playsound does.

Not exactly sure how to change the 1945 game code, but maybe someone else can.  Running the game from the .lua source code causes the game to lockup, but the .exe runs fine.  Yet can't create another .exe from the IDE, as it gives me an error.  Hmm...

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: 1945 Shooter Example...
« Reply #2 on: February 28, 2015, 09:30:16 AM »
Yes, that's right. You can only play one music at the same time. That's a limitation by SDL, OTOH it doesn't make sense two play two music files at the same time ... wehreas you can use different sounds at the same time.
In PulsarLua you will be able to use freemusic(), after that another music file can be loaded and played (but also not at the same time).


Luposian

  • Guest
Re: 1945 Shooter Example...
« Reply #3 on: February 28, 2015, 03:29:17 PM »
In playing two songs at the same time, using both playmusic and playsound, it was a jumbled mess (as expected).  But I was trying to determine if you COULD play any two sounds (.wav can be played by both playsound and playmusic) at the same time, because 1945 only has music during the title and not during the game, itself.  It COULD have music playing during the game, with sound effects going, if coded that way.  Just not sure how to properly code it that way, in the 1945 game.  As I said, I'd like to be able to use 1945 as a foundation for another game idea of mine, but it's current (as coded presently) audio "issue" makes that unfeasible.