Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zawran

Pages: [1] 2 3 4 5 6 7 8 ... 38
1
I have not visited this forum in like forever. Not sure why I decided to take a look this evening. But I might actually have the code examples somewhere on a backup drive. Would have to find some of my old drives, connect them and look for them first though.

If someone would like to receive them, should I manage to find them, then please write me an email where you mention that you would like to get a mail with link to the examples.

I have updated my profile with a current mail address.

I will make an note to myself that I need to look for them tomorrow.

Best regards
zawran (Johnny)

2
General chat / Merry Christmas to all
« on: December 23, 2013 »
I would like to wish you all a Merry Christmas.

3
General chat / Re: Hello and apologies
« on: November 23, 2013 »
It has been ages since I last checked in here. I have been busy with just about anything else than demo coding. I am trying to find time to work on a game though, so I do get a little bit of coding done every now and then. But in life things chance and noone really keep doing the same thing over and over. But it is nice to know you are doing great.

Merry Christmas and a happy New Year to you all.

4
Blitzmax, working on a game. Have not done any demo related coding i ages :(

5
General chat / Re: Happy New Year 2013
« on: January 01, 2013 »
Happy New Year to each and everyone. I have had a break from programming for a while as well, but 2013 will see a change for the better that much is sure.

Hopefully everyone got through the night with all their eyes, fingers, etc intact. :)

6
General chat / Re: Merry Xmas and Happy New year to all
« on: December 25, 2012 »
Merry Christmas everyone, may you get some great gifts and be in good company during the holiday season.

7
Hi Jon, for your Giana platformer, if you decide to continue it, you can find the original C64 graphics in this open source Giana project:

http://sourceforge.net/projects/openggs/

8
Would it not be easier to use .png image and make use of the alpha channel? .bmp does not have any alpha information stored, so with those you will have to mess with some kind of masking, but with .png you do not, you simply upload the texture and make sure that you have setup opengl to use alpha blending.

I do no longer have freebasic available, have not used it for a few years, so I am unable to assist with your actual code. The above is just a suggestion as to what might make it easier to work with.

9
Projects / Re: HLSL Tunnel
« on: June 27, 2012 »
I see what you mean about the bump not turning out as great as it could. You would probably have to not have the shader darken the tunnel and have to set up lights and such. The non bump version looks better as it is now. But as you said, you figured out how to use two textures, which mean that it was not all for nothing :)

10
Projects / Re: HLSL Tunnel
« on: June 25, 2012 »
I tried it on a WinVista computer with an ATI 4300HD series card, so nothing fancy, but it runs smooth and no issues at all. It looks brilliant. Would it be possible to do some kind of bumpmapping at the same time, probably using normalmaps or something? I think it would make it even more great. Good job on hacking your way into getting dx shaders working with bmax, as you mention not a lot of people dabble in that kind stuff.

11
General coding questions / Re: HLSL ps_3_0 issue
« on: June 24, 2012 »
That looks rather cool. Psychodelic colors, but cool none the less :)

12
General chat / Re: klystrack!
« on: June 07, 2012 »
I have attaced a player. It does not do much else but play the tunes. When run it will show a filerequester where you can pick the tune. To stop it, press the ESC key or click on the close icon. You can pause/unpause using the P key.

13
General chat / Re: klystrack!
« on: June 07, 2012 »
Consider the blitzmax wrapper code public domain and do with it as you please.

14
General chat / Re: klystrack!
« on: June 02, 2012 »
Seeing that RBZ has made a wrapper for freebasic using the static library so that you do not have to have the dll file in the folder, I thought that I would give it a go at making the wrapper do the same for Bmax. And after some thinkering I managed to get it to work.

Here is the new type for the wrapper:

Code: [Select]
Private
Extern "Os"
Function KSND_CreatePlayer:Byte Ptr(samplerate:Int)"C"
Function KSND_FreePlayer(kplayer:Byte Ptr)"C"
Function KSND_PlaySong(kplayer:Byte Ptr,ksong:Byte Ptr,position:Int)"C"
Function KSND_Stop(kplayer:Byte Ptr)"C"
Function KSND_Pause(kplayer:Byte Ptr,state:Int)"C"
Function KSND_GetPlayPosition:Int(kplayer:Byte Ptr)"C"
Function KSND_SetVolume(kplayer:Byte Ptr,volume:Int)"C"
' song calls
Function KSND_LoadSong:Byte Ptr(kplayer:Byte Ptr,path:Byte Ptr)"C"
Function KSND_LoadSongFromMemory:Byte Ptr(kplayer:Byte Ptr,mem:Byte Ptr,length:Int)"C"
Function KSND_FreeSong(ksong:Byte Ptr)"C"
Function KSND_GetSongLength:Int(ksong:Byte Ptr)"C"
End Extern
Public

Type TKSND
Field player:Byte Ptr ' handle to active player
Field song:Byte Ptr ' handle to currently playing song

Function init:TKSND(samplerate:Int)
Local tmp:TKSND = New TKSND
tmp.player = KSND_CreatePlayer(samplerate)
Return tmp
End Function

' Player methods

Method play(position:Int=0)
KSND_PlaySong(Self.player,Self.song,position)
End Method

Method pause(state:Int=0)
' 1 = pause, 0 = continue
KSND_Pause(Self.player,state)
End Method

Method stop()
KSND_Stop(Self.player)
End Method

Method free()
KSND_FreePlayer(Self.player)
End Method

Method setVolume(volume:Int)
KSND_SetVolume(Self.player,volume)
End Method

Method getPlayPosition:Int()
Return KSND_GetPlayPosition(Self.player)
End Method

' Song methods

Method loadSong(path:String)
' check if a song is already loaded
If Self.song <> Null Then Self.freeSong()
Self.song = KSND_LoadSong(Self.player,path.ToCString())
If Self.song = Null Then
RuntimeError "Unable to load song: "+path
Else
Print "song loaded"
End If
End Method

Method loadSongFromMemory(mem:Byte Ptr,length:Int)
' check if a song is already loaded
If Self.song <> Null Then Self.freeSong()
Self.song = KSND_LoadSongFromMemory(Self.player,mem,length)
If Self.song = Null Then
RuntimeError "Unable to load song!"
Else
Print "song loaded"
End If
End Method

Method freeSong()
KSND_FreeSong(Self.song)
End Method

Method getSongLength:Int()
Return KSND_GetSongLength(Self.song)
End Method
End Type

And here is a new example to show how it is called:

Code: [Select]
SuperStrict
Import "-lksndstatic"

Incbin "Paranoimia (Suntronic).kt" ' this is for including the song in the exe

Include "TKSNDstatic.BMX"

Graphics 800,600


' prepare a player
Global music:TKSND = TKSND.init(44100)

' use this when loading song from bank
Global bk:TBank = LoadBank("incbin::Paranoimia (Suntronic).kt") ' this loads the song into a bank
music.loadSongFromMemory(LockBank(bk),BankSize(bk))
bk = Null

' use this when loading song from disc
'music.loadSong("obspatial.kt")

' play the music
music.play()

Global mute:Int = 0

While Not KeyHit(KEY_ESCAPE)
Cls
Local sl:Int = music.getSongLength()
Local pp:Int = music.getPlayPosition()
DrawText("Song Length: "+sl,8,8)
DrawText("Play Position: "+pp,8,24)
If mute = 1 Then DrawText("MUTED",8,48)
' check for pause/continue
If KeyHit(KEY_P) Then music.pause(1)
If KeyHit(KEY_C) Then music.pause(0)
' check for mute/unmute
If KeyHit(KEY_M) Then
mute = 1-mute
If mute = 0 Then
music.setVolume(100)
Else
music.setVolume(0)
End If
End If
Flip
Wend
music.freeSong()
music.free()
End

So instead of copying the dll file to your project folder, you copy the following file "libksndstatic.a" to the "lib" folder in your Bmax installation folder.

Using this version will pack the player code into your exe and you no longer need the dll file. Please note that new line <Import "-lksndstatic"> at the top of the example. You will have to have that line in the top of your project code along with what other imports you have. It is the line that loads the c library.

15
General chat / Re: klystrack!
« on: June 01, 2012 »
No problem, it was fun trying to get it to work.

16
General chat / Re: klystrack!
« on: June 01, 2012 »
I took a look at getting it to work with Bmax, and here is some code for you:

Code: [Select]
'
' load the KSND DLL into memory
'
Const KSND_DLL:String = "ksnd.dll"
Global g_hndDLL:Int
g_hndDLL = loadlibrarya(KSND_DLL)
If g_hndDLL = Null Or g_hndDLL = 0 Then
RuntimeError "Unable to find the file: "+KSND_DLL
End If

Private
' player calls
Global KSND_CreatePlayer:Byte Ptr(samplerate:Int)"Win32" = GetProcAddress(g_hndDLL,"KSND_CreatePlayer")
Global KSND_FreePlayer(kplayer:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_FreePlayer")
Global KSND_PlaySong(kplayer:Byte Ptr,ksong:Byte Ptr,position:Int)"Win32" = GetProcAddress(g_hndDLL,"KSND_PlaySong")
Global KSND_Stop(kplayer:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_Stop")
Global KSND_Pause(kplayer:Byte Ptr,state:Int)"Win32" = GetProcAddress(g_hndDLL,"KSND_Pause")
Global KSND_GetPlayPosition:Int(kplayer:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_GetPlayPosition")
Global KSND_SetVolume(kplayer:Byte Ptr,volume:Int)"Win32" = GetProcAddress(g_hndDLL,"KSND_SetVolume")
' song calls
Global KSND_LoadSong:Byte Ptr(kplayer:Byte Ptr,path:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_LoadSong")
Global KSND_LoadSongFromMemory:Byte Ptr(kplayer:Byte Ptr,mem:Byte Ptr,length:Int)"Win32" = GetProcAddress(g_hndDLL,"KSND_LoadSongFromMemory")
Global KSND_FreeSong(ksong:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_FreeSong")
Global KSND_GetSongLength:Int(ksong:Byte Ptr)"Win32" = GetProcAddress(g_hndDLL,"KSND_GetSongLength")
Public

Type TKSND
Field player:Byte Ptr ' handle to active player
Field song:Byte Ptr ' handle to currently playing song

Function init:TKSND(samplerate:Int)
Local tmp:TKSND = New TKSND
tmp.player = KSND_CreatePlayer(samplerate)
Return tmp
End Function

' Player methods

Method play(position:Int=0)
KSND_PlaySong(Self.player,Self.song,position)
End Method

Method pause(state:Int=0)
' 1 = pause, 0 = continue
KSND_Pause(Self.player,state)
End Method

Method stop()
KSND_Stop(Self.player)
End Method

Method free()
KSND_FreePlayer(Self.player)
End Method

Method setVolume(volume:Int)
KSND_SetVolume(Self.player,volume)
End Method

Method getPlayPosition:Int()
Return KSND_GetPlayPosition(Self.player)
End Method

' Song methods

Method loadSong(path:String)
' check if a song is already loaded
If Self.song <> Null Then Self.freeSong()
Self.song = KSND_LoadSong(Self.player,path.ToCString())
If Self.song = Null Then
RuntimeError "Unable to load song: "+path
Else
Print "song loaded"
End If
End Method

Method loadSongFromMemory(mem:Byte Ptr,length:Int)
' check if a song is already loaded
If Self.song <> Null Then Self.freeSong()
Self.song = KSND_LoadSongFromMemory(Self.player,mem,length)
If Self.song = Null Then
RuntimeError "Unable to load song!"
Else
Print "song loaded"
End If
End Method

Method freeSong()
KSND_FreeSong(Self.song)
End Method

Method getSongLength:Int()
Return KSND_GetSongLength(Self.song)
End Method
End Type

And here is an example of using the above code:

Code: [Select]
SuperStrict
Incbin "obspatial.kt" ' this is for including the song in the exe

Include "TKSND.BMX"

Graphics 800,600


' prepare a player
Global music:TKSND = TKSND.init(44100)

' use this when loading song from bank
Global bk:TBank = LoadBank("incbin::obspatial.kt") ' this loads the song into a bank
music.loadSongFromMemory(LockBank(bk),BankSize(bk))
bk = Null

' use this when loading song from disc
'music.loadSong("obspatial.kt")

' play the music
music.play()

Global mute:Int = 0

While Not KeyHit(KEY_ESCAPE)
Cls
Local sl:Int = music.getSongLength()
Local pp:Int = music.getPlayPosition()
DrawText("Song Length: "+sl,8,8)
DrawText("Play Position: "+pp,8,24)
If mute = 1 Then DrawText("MUTED",8,48)
' check for pause/continue
If KeyHit(KEY_P) Then music.pause(1)
If KeyHit(KEY_C) Then music.pause(0)
' check for mute/unmute
If KeyHit(KEY_M) Then
mute = 1-mute
If mute = 0 Then
music.setVolume(100)
Else
music.setVolume(0)
End If
End If
Flip
Wend
music.freeSong()
music.free()
End

The known bugs are that the method for getting the length of the song returns a wrong number in release mode, but works correct in debug mode. I am not really sure where the problem lies, but since it is not something that will prevent people from using the klystrack tunes in their productions I figured that I might as well release the code already. I hope someone finds it useful. Remember to copy the ksnd.dll file to your project folder.

17
General chat / Re: AV software that doesn't suck
« on: May 28, 2012 »
I am rather happy with MS Essentials, it just seems to work, and it does not hog the computer at all. Also I do not want to pay for software like that because I feel that those companies who produce it has an interest in having the bad software flowing, so I feel that it should be something that the developer of the system software should handle, and MS is doing a fine job with it I think.

18
General chat / Re: Long time no post and free games
« on: April 14, 2012 »
It sure is great to be programming on a regular basis again, so I will probably be making more games in the near future. We will see about the challenge if I get any good ideas.

19
General chat / Long time no post and free games
« on: April 13, 2012 »
Hi Everyone,

Wow its been ages since I have posted here. I do check in every now and then though, so I try to keep up with whats going on. But I have not been overly active one might say. Well I have recently been getting back to programming again, but not demo related stuff, but more game related. I am working on some coding libraries to help me speed up development of future games, and while doing so I have put together four different games which I have uploaded to my website.

They are free as in free beer, so you are welcome to download them and even copy them to your friends and family if you feel like it.

You can get them from this page: http://zac-interactive.dk/blog/?page_id=20

I saw that there is a cube challenge, I might even consider that one. I should be able to make a cube spin, I should think :)  Well, we will see. I hope you are all doing well. Cheers.

20
Its been quite a while since I have used Blitz3D and BlitzPlus, so I might not remember the syntax exactly.

Code: [Select]
' here is your double loop where you find out if a shell collide with a box
For Player.shell = Each shell
      For b.box = Each box
          If ImagesCollide (shellimage, Player\x, Player\y,0,  Computer, b\bX, b\bY,0 )
            player\deleteflag = 1
            b\deleteflag = 1
         EndIf
      Next
   Next
' now you go though each shell to see if it needs to be deleted
For Player.shell = Each shell
   if player\deleteflag = 1 then delete player
next
' and then you go though each box to see if it needs to be deleted
For b.box = Each box
   if b\deleteflag = 1 then delete b
next

Off the top of my mind I don't remember any way around this unfortunately. And welcome to the forum btw :)

Pages: [1] 2 3 4 5 6 7 8 ... 38