Oxygen Basic

Programming => Example Code => Topic started by: Peter on October 25, 2010, 09:22:53 AM

Title: Pac3D Demo
Post by: Peter on October 25, 2010, 09:22:53 AM
Deleted
Title: Re: Pac3D Demo
Post by: Charles Pegge on October 25, 2010, 11:05:06 AM

Many Thanks Peter!

This is a very significant first for Oxygen.

My survival time is around 4 seconds - I might improve with practice. In between bouts of hardcore programming.

Your game works fine on my PC with Alpha018 but not with Alpha019 which I am working on at present. 019 has had a complete rework of the string management and garbage collection system correcting a few more memory leaks.. So I would advise including Alpha018 Oxygen.dll with your game as a complete package. I will Also retain 018 on SourceForge for a while.

Charles
Title: Re: Pac3D Demo
Post by: Charles Pegge on October 27, 2010, 12:49:43 AM
Thanks Peter.

O2 can read C headers but It will be good to have a cmpact 'MinWin' with all the essentials for accessing the Windows API.

I wonder if Linux uses the same keyboard mappings. - if most of these are scan-codes direct from the keyboard..

Charles
Title: Re: Pac3D Demo
Post by: kryton9 on October 27, 2010, 04:47:45 PM
Very cool Peter. Ran smoothly here and is fun. I have yet to beat it, but got close, got all the yellow pills and atoms, couldn't lay any bombs, so I am doing something wrong. Got killed trying to lay a bomb.
Title: Re: Pac3D Demo
Post by: Charles Pegge on October 29, 2010, 06:04:22 AM
Hi Peter,

Oxygen strings are dynamic - which means indirect bstring. Try this:

     Dim song as long
     Dim snd as string
     snd = "tada.wav"
     song = *snd
            
     push 1
     push 0
     push song  
     call PlaySound

Title: Re: Pac3D Demo
Post by: Charles Pegge on October 29, 2010, 06:03:53 PM
You could use a zstring buffer instead:

Dim song as long
     Dim snd[128] as zstring
     snd = "tada.wav"
     song = &snd
             
     push 1
     push 0
     push song   
     call PlaySound

or even a string literal:

             
     push 1
     push 0
     "tada.wav"
     push eax

     call PlaySound

Charles