Page 2 of 4

Posted: Thu Jul 03, 2003 8:23 pm
by LarsG
Looking good Hypervox.. keep it up! :D

Lars

Posted: Thu Jul 03, 2003 8:48 pm
by tinman
Do you really need to create a gadget list if you have no gadgets?

Posted: Thu Jul 03, 2003 10:04 pm
by hypervox
probably not! That's the Visual Designer for you.....

I think I'll change that to read "only if you're going to use a gadget!" :oops:

Thanks Tinman :)

Nice

Posted: Sun Jul 06, 2003 6:30 am
by LJ
Nice work.

Posted: Sun Jul 06, 2003 8:45 am
by Searhin
Thanx a lot hypervox! Great work (and please do continue :D )

Posted: Thu Jul 10, 2003 1:16 pm
by hypervox
Next stage of the game creation tutorial has been posted - Simple Sprites

Screen Save...

Posted: Fri Jul 11, 2003 6:00 am
by LJ
The tutorial says:" ; save screenshot
If KeyboardPushed(#PB_Key_F1)
GrabSprite(#snapshot,0,0,#SCREEN_WIDTH,#SCREEN_HEIGHT)
SaveSprite(#snapshot,"screenshot.bmp")
EndIf"

However, in the actual source code available for download, there is no save screenshot code. I added the code manually myself, and found it didn't work properly, only grabbed a blank black screen.

Nice work. I'm enjoying your tutorial very much.

Lj

Posted: Fri Jul 11, 2003 10:02 am
by hypervox
Sorry LJ - the correct source has been uploaded.

The snapshot code has to go just after the first initial keycheck, like so....

;///////////////////////////////////////////////////
;- Input
;///////////////////////////////////////////////////
;check keyboard For input
;if escape pressed, leave program,
;if + or - pressed, change speed of starfield
ExamineKeyboard()
If KeyboardPushed(#PB_Key_Escape)
done = 1
EndIf

; save screenshot
If KeyboardPushed(#PB_Key_F1)
GrabSprite(#snapshot,0,0,#SCREEN_WIDTH,#SCREEN_HEIGHT)
SaveSprite(#snapshot,"screenshot.bmp")
EndIf

OK

Posted: Sat Jul 12, 2003 6:56 am
by LJ
OK, excellent! Everything is working great!

Hypervox

Posted: Sat Jul 19, 2003 9:44 pm
by LJ
Hypervox, how is your next tutorial coming along? I've really enjoyed the ones you've created so far.

Posted: Mon Jul 21, 2003 11:04 am
by hypervox
next one should hopefully be ready in a couple of days, and will concern animated sprites.

(p.s. sorry for the delay everyone, other commitments etc... :wink: )

Posted: Wed Jul 23, 2003 10:06 pm
by hypervox
next tutorial available - animated sprites & sounds!

Rgrds everyone

Hypervox :D

Nice...

Posted: Fri Jul 25, 2003 5:03 am
by LJ
Your latest tutorial is fantastic.

The sounds are functioning, hmmm, how to describe,... in a inconsistent way. Notice that when the program is first run, the background sound voidhum.wav is of a good volume. As the program is running, if you push the space bar which plays phaser.wav it sounds good. But sometimes when you push the spacebar, the volume of the first sound, voidhum.wav, decreases and is hardly audible. The phaser.wav volume decreases also. Now push the space bar a few more times, and if you're lucky, the volume suddenly increases again back to its original volume and everything sounds great. As you push the space bar at different times and different speeds, the sound makes almost a crackle sound, but not quite and again, the volume decreases. Sometimes you are stuck at a decreased volume for both the phaser.wav and the voidhum.wav for a considerable amount of time, but eventually, if you keep pushing the spacebar, you can get the volume to increase again.

I notice that with the PlaySound command, there doesn't appear to be different channel to load the sound as in the Blitz3D language. Could the problem be that because there are not different channels, by repeating the sound before its completely finished cause the decrease in volume?
The logic is that EVERYTIME the program is first executed, the volume is always correct. But when the phaser.wav sound is introduced on the same channel and stopped and started at different times, the volume alternates between a very low and normal state.

And if everyone gets the problem I described above, is this a bug to report to Fred or is it corrected by allowing the phaser sound to fully play and terminate before playing again?

Posted: Fri Jul 25, 2003 9:33 am
by hypervox
What's happenning is that the Playsound command for the phaser sound is being fired every time the space key is pressed. If you hold down the space key, the sound plays repeatedly. Depending on how fast your keyboard repeat is, this can give the effect of the sound being "chopped off", or even silence!

I don't think the volume itself is changing, but this repeat effect could manifest itself this way.

I think I'll post a query on this, because I'm not happy with this situation. The Windows PlaySound API call can stop a sound if it's already playing, but I think it can also not play a sound if it's already in progress. Let's see what Fred says...

OK

Posted: Fri Jul 25, 2003 3:52 pm
by LJ
Ok. I've tried modifying your code to fix, but no luck. I tried just changing the frequency of the hum noise, I tried detecting if the sound was still playing using the initsound command, no luck.

The only thing that would possibly work is to stop game execusion with a delay command until the sound finished, but that would be terrible as far as game playability goes.

What we need is a way to detect if the phaser sound is still playing, and if it is, don't play it again. The problem with using the initsound command to do this is that the other sound, the hum sound is playing in the background and so the initsound command always returns that the sound is busy.