Oxygen Basic

Programming => Example Code => Topic started by: Peter on March 23, 2013, 04:00:28 AM

Title: RawLoader & Rawprites
Post by: Peter on March 23, 2013, 04:00:28 AM
Deleted
Title: Re: RawLoader & Rawprites
Post by: JRS on March 24, 2013, 11:21:25 AM
On that note, I'm trying to write a Sokoban map converter to your SokoMouse edition. Can you explain why you are using 3 maps when all the other Sokoban maps I've seen do it in one.

Code: [Select]
    #####
    #   #
    #$  #
  ###  $##
  #  $ $ #
### # ## #   ######
#   # ## #####  ..#
# $  $          ..#
##### ### #@##  ..#
    #     #########
    #######

(http://webdocs.cs.ualberta.ca/~games/Sokoban/Mazes/Screens/screen.1.jpg)
Title: Re: RawLoader & Rawprites
Post by: JRS on March 24, 2013, 05:13:32 PM
Peter,

SokoMouse is definitely a nicer version of the game. I'm trying to write a Sokoban map to SokoMouse maps converter. It looks like a parsing job to me to build the three needed files. Am I missing something or are the two map formats incompatible between games? Thanks for the explanation of your three map files, it helps to better understand your game design.

John
Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 07:34:48 AM
Thanks Peter for the history of SokoMouse.

I think my direction for the SB version of SokoMouse will be to use a two dimensional array to store map data. This will allow me to use the existing format and add a routine to load Sokoban text maps if a filename is an argument to starting the game.

map[level,layer] = binary_map_string
Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 09:46:49 AM
Peter,

I think I can generate SokoMouse map arrays from Sokoban maps. Thanks for your help Peter!


(http://files.allbasic.info/ScriptBasic/sm_01.png)

Code: [Select]
Layer 1:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 0 0 0
0 0 0 0 0 2 2 2 3 3 3 2 2 2 0 0 0 0 0 0
0 0 0 0 0 2 3 3 3 3 3 3 3 2 0 0 0 0 0 0
0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 0 0 0
0 0 0 0 0 2 2 2 0 0 0 2 2 2 0 0 0 0 0 0
0 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0
0 0 0 0 0 2 0 0 2 0 2 0 0 2 0 0 0 0 0 0
0 0 0 0 0 2 2 0 2 4 2 0 2 2 0 0 0 0 0 0
0 0 0 0 0 2 0 4 0 6 0 4 0 2 0 0 0 0 0 0
0 0 0 0 0 2 0 0 0 2 0 0 0 2 0 0 0 0 0 0
0 0 0 0 0 2 2 2 2 2 2 2 2 2 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 10:14:22 AM
Damn you're quick!

I thoiught I could fix my typo in my script before you saw the original post. Anyways I think I'm good to go.  :-*
Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 03:10:00 PM
I'm curious why the double 9's in level 2 for the outside walls?

I can't see anywhere in the program 9 is even referenced as a point in the maps. Was this a leftover from some other feature?

Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 06:45:21 PM
This looks like the Sokoban map standard coding method.



I would like to adapt the ScriptBasic version of SokoMouse to using a standard Sokoban map format.

Title: Re: RawLoader & Rawprites
Post by: JRS on March 25, 2013, 08:36:32 PM
Too bad this open source Sokoban game (http://sourceforge.net/projects/sokobanyasc/?source=navbar) is in Pascal.  :-\  (setup just for Peter)

(http://files.allbasic.info/ScriptBasic/SM/yasc.png)

Title: Re: RawLoader & Rawprites
Post by: JRS on March 26, 2013, 05:52:49 AM
Quote
Is this a Sokonban from the hell ?

You're the skulls & crossbones guy and I even used your original SokoMouse background. I would say that is a custom Peterbuilt rig if you ask me.  :D

Quote
Do we have a Soko mania now ?

Actually I have spent way too much time on this already. I could never top the version above and I'm not a gamer anyways. It was my first game coding project and you know what they say about the first time.  ;D

If I have some spare time, about the only thing I might add to SokoMouse is the ability to read a file of Sokoban maps and a undo feature. Deadlock notice, solvers and map creators are beyond me and not my cup of tea.

Thanks for all the time you invested in this, it was a lot of fun. (and time consuming)
Title: Re: RawLoader & Rawprites
Post by: JRS on March 26, 2013, 11:37:09 AM
Quote
Microsoft has destroys my life. I am  software beggar now.

Next time I take a run down to Redmond, I deposit a few of these signs around the Microsoft campus as feedback from the other side of the pond.
Title: Re: RawLoader & Rawprites
Post by: JRS on March 28, 2013, 04:47:17 PM
Peter,

This example (http://forum.basicprogramming.org/index.php/topic,2846.0.html) would be interesting to see running using Simple Window.

VIDEO (http://www.youtube.com/embed/ufPIdF-f6s8)