SonicX-treme V(6)
(use word wrap and full screen)
www.geocities.com/jo9992/qbasic.html
Please send all correspondence regarding this release to my email
address at prodigy_2000@start.com.au.
All the *.bmp files should be in the sub directory pics.

Contents:
-What's new
-Send in your levels
-Overview of utilities
-The long explanation

What's new
-256 colors
-new joystick routines
-great new file selection system
-sonicx, tilemapg and tileditg now have a front end
-sonicx now has a console
-the sonic character map has been completely redone for 256 colors
-so much more that i can't write it all down

Send in your levels
Any levels that are sent to my email adress at prodigy_2000@start.com.au will be put on my web page. You mightn't
get famous from it, but you can be sure that a lot of people will
play your level.

Overview of utilities
Sonicx.bas:
Sonic X(treme) source code for use with QuickBasic 4.5. This is the way
it is meant to be played. It requires the included library sonicx to be
loaded. Make sure that the files sonicx.lib sonicx.bi, and sonicx.qlb are
in your qbasic 4.5 directory. Then all you have to do is to load
qb.exe in the following way. 
-----------------------------
Type qb.exe /l sonicx /ah
-----------------------------
The ah option is needed because sonicXtreme uses arrays bigger then 64k. 
 Once you have qb4.5 running, search for 'include$ = "c:\qb4.5\sonicx.bi"
and change it to the path you have sonicx.bi in. Also, search for chdir
 and change the associated path to the directry you installed sonic xtreme
into. Last but not least, press f5



Winsonic.exe




SonicX.exe
This runs *.lvl files of version 5 standard and is a decent clone of
sonic the hedgehog on Megadrive(genisis).

Usage:
sonicx.exe has a file selector when you run it that will load the level of your 
choice. 

The keys for sonicx.exe are ;
up arrow      :  makes sonic jump    
right arrow   :  makes sonic run right
left arrow    :  makes sonic run left 
down arrow    :  makes sonic do the super spin dash if running and makes sonic look down if not
Esc           :  ends game
F3            :  toggles joystick mode on and off
tilde(~)      :  opens console

Console commands:
1. Type a variable and press enter to check the variables value
eg :dx%
   :"dx%" = "143"
2. Type a variable followed by a value to change the variables value
eg :jumpp% 1
   'the sonic sprite will jump  
refer to variable_list for variables

variable_list:
x%
y%
dx%
dy%
jumpp%
speed!
accelerate!
speedvar!
inix%
iniy%
jumpdown%
jumpspeed!
js!
jumpspeeds!
ac%
eac%
mac%
bac%
inispeed
downs%
downn%
h%
col%
levellimit%
levellimit2%
obj%
spiker%
grad%
zero%
gravity%
wall%


v6 revisions:
It has 256 colours
It's faster
it has a flile selector and a front end menu

v5 revisions :
now runs V2.3 levels as well
better keyboard routines. You can now hold 2 keys at a time.
new animations
Unlimited textures
Faster rendering
animations
rings
sigpost
power ups
springs for super jumping
object collision detection
score counter
time counter
ring counter
live counter
all the counters use the same font as the original sonic version.
speed optimisations
miscellaneous updates of utilities

v 2.3 revisions :
graphical anomolies in tilemapd have been fixed
graphical anomolies in sonicx have been fixed
text in sonicx.exe now blends in with background.
sonicx now has a maximum fps of 20 fps, which allows the game to become playable on high end computers.

v 2.2 revisions :
speed increase
mega CD mode
better collision detection
joystick support

v 2.1 revisions :
some bugs with the tileditor have been fixed , but you must save the first pic you draw , or it will stuff up.
fixed some bugs in sonicX.exe
includes a much better level
enhanced tilemapc.exe









Level files:
The included level file is metro.lvl.The level will work in SonicX.exe or the
Qbasic 4.5 source code. To run a level, open up sonicx and choose the level
in the file selector.

Tilemapg.exe
Level editor Version 6 :2000
Usage:
Tilemapg.exe [(level file).lvl]
This program creats level files of version 5 standard that can be run
using sonicX.exe. It requires a texture file to work. Included texture
file is larger.tex.

Tilemap.exe allows you to create a level of sonic the hedgehog by using the tiles you made in the 
tile editor. It also allows you to implement events at certain pionts in the game like selecting where sonic starts using the start function or allowing sonic to run up a hill using the gradient function. In order for tilemap.exe to start , it requires that at least one .tex file has been made using tileedit.exe. An error could also occur if a level had been made , but the .tex file  had been deleted or replaced. 
There are a couple of different modes that can be selected by left clicking an on screen icon.
--------------------------------------------------------
Icon       :   Mode                    :Hotkey
--------------------------------------------------------
none       :   Undo                       :  U
Tp         :   Tile placement mode        : none
Bp         :   Background placement mode  : none
Mp         :   Midground placement mode   : none
Ep         :   Endground placement mode   : none
Op         :   Object placement mode      : none
Flag       :   Start mode                 : none
Z and line :   Zero gradient mode         : none
Slope line :   Gradient mode              : none
W and line :   Wall mode                  : none
Folder     :   Load or create new file    : none
S and line :   Spike mode                 : none
none       :   Delete level               : F7
none       :   End program                : escape or F1 
none       :   Scrolling                  : numpad keys or arrow keys
none       :   Next tile                  : F8
none       :   Load a midi                : m
none       :   Map mode                   : z

------------------------------------------------------------------------------------------------
    Mode                  :           Explanation
------------------------------------------------------------------------------------------------
Undo                      : Undoes the last action. 
Tile placement mode       : In this mode , You place the tiles that are in the same zoom level as
                          : sonic. To select a tile, press F8 Once you have selected a tile you                            : can set it in the desired position by using a mouse and clicking on                            : the left mouse button. 
Background placement mode : In this mode , You place the tiles   in the zoom level behind sonic                            : and far away. To select a tile press F8 . Once you have selected a                             : tile you can set it in the desired position by using a mouse and                               : clicking on the left mouse button.
Midground placement mode  : In this mode , You place the tiles in the zoom level behind sonic but                           : closer then the background tile mode. To select a tile press F8 .                              : Once you have selected a tile you can set it in the desired position                           : by using a mouse and clicking on the left mouse button 
Endground placement mode  : In this mode , You place the tiles in the zoom level in front of                               : sonic and about as far away as the midground mode. To select a tile                            : press F8. Once you have selected a tile you can set it in the desired                           : position by using a mouse and clicking on the left mouse button 
Object placement mode     : Probably the most important mode in the game, at least in terms of                           : playability. It allows you to place objects such as rings, extra                           : lives, or even springs into the level.
Start mode                : In this mode ,You set the starting place of sonic in the level. Move                           : the mouse cursor to the desired position and left click the mouse 
                          : button.
Zero gradient mode        : In this mode ,You set the boundary for each platorm that sonic walks                           : on. Sonic can jump from one platform to another if the boundaries are                           : set.If the boundary isn't set at all , sonic will just fall through                            : the platform. To set the boundary, left click the 1st point on the                             : platform and hold the button down as you move the cursor to the 2nd                            : point on the platform. Release the button to set the boundary.This                             : mode should only be used if the platform is flat. For diagnal 
                          : platforms , use the gradient mode.
Gradient mode             : In this mode ,You set the boundary for each platorm that sonic walks                           : on. Sonic can jump from one platform to another if the boundaries are                           : set.If the boundary isn't set at all , sonic will just fall through                            : the platform. To set the boundary, left click the 1st point on the                             : platform and hold the button down as you move the cursor to the 2nd                            : point on the platform. Release the button to set the boundary.This                             : mode should only be used if the platform is diagnal. For flat 
                          : platforms , use the zero gradient mode.  
Wall mode                 : In this mode you can set a wall that sonic can't run through. For                              : instance, you might want to have a wall that connects to a platform                            : so that sonic can't walk under the platform. To use it , left click                            : the first point of the vertical line and hold the button until you                             : find a suitable second point.
Load or create new file   : Allows you to load a .lvl file or to create a new .lvl file.
Spike mode                : This mode allows you to set the boundarys of an object that kills
                          : sonic , like spikes.To set the boundary, left click the 1st point on                           : the object and hold the button down as you move the cursor to the                              : 2nd point on the object.
Delete level              : Deletes all of the level file information so you can re-start the                              : level.
End program               : Saves the .lvl file and ends the program.
Scrolling                 : You can scroll through out the level using the numpad or arrow keys
                          : or the mouse.
Next tile                 : Skips to the next tile.
Load a midi               : Allows you to specify the midi file (under 100 kb) that the level
                          : will play if the sound is on.make sure you include the .mid extension
Map mode                  : Map mode zooms out so that you can see the level from further away
                          : and pinpoint problems with levels.
 
This program isn't perfect and there is a lot of optimisation to be done ,but at the moment there can only be a certain number of things being rendered on the screen at once before it slows to a snails pace.Keep the graphics sparse and draw the tiles conservatively.
If nothing works at all then DON'T PANIC, delete the .lvl file and the level.ini file


SonicX.exe runs the level you have created :)

To make it run a particular level , there are 3 things you can do;
1, run sonicx.exe and choose the level in the file selector
2, edit the script file and run sonicx.exe 
Here is an example of editing the script.ini file

-------------------------------------------------------------------------------------------------
2
1.15
10
space.lvl

Usage ;
2 = speedvar! 'controls the speed at which sonic decellerates
1.15 = accelerate!  'controls the speed at which sonic accellerates
10 = inispeed%   'Set's the maximum speed achieavable
space.lvl = level$    'level to be loaded
-------------------------------------------------------------------------------------------------
speedvar! is the variable that controls the speed at which sonic decellerates
accelerate! is the variable that controls the speed at which sonic accellerates
inispeed% is the variable that sets the maximum speed sonic can reach
level$ is the string variable of the level to be loaded
I allowed speedvar!,accelerate and inispeed% to be changeable so that some of you would
be able to experiment with it to find the right mix.
To change a variable , match the number with the variable under "usage;" that has the same number
and change the top one.Please note that every thing under "usage;" isn't read by the game.
To change the level , type the name of the level and include the .lvl extension where
space.lvl is.

To play with sound run sonicxws.bat . If there is an error , It is because a midi file hasn't
been specified for the level you are running yet. Just open the level with the tilemap.exe
program and press m to specify a midi file.

The keys are;
up arrow      :  makes sonic jump    
right arrow   :  makes sonic run right
left arrow    :  makes sonic run left 
down arrow    :  makes sonic do the super spin dash if running and makes sonic look down if not
Esc           :  ends game
F3            :  toggles joystick mode on and off


Levelch2.exe
Level updater Version 1 :2000
Usage:
Tilemapg.exe [(level file).lvl]
This program updates level files made from previous releases of the 
level editor to the new version 5 standard. This should please a
great many of you. 

Tileedit.exe
****Warning**** Do not load object.tex or larger.tex into the tile editor*****
Texture editor Version 5 :2000
Usage:
Tileedit.exe [(texture file).tex]
This program creats texture files of that can be run in Tilemapg.exe
Tileedit.exe allows you to draw tiles to use in the game.  You must not enter the same name twice . Doing so will cause an error and you will have to delete the .tex file and the tile.ini file
to get it to run properly again. 
the keys are; 
F1  ends the program and saves the tile 
F2  changes the colour to the next colour
F3  changes the colour to the previous colour
arrow keys:
up scrolls up
down scrolls down
left scrolls left
right scrolls right

All the drawing is done through the mouse. The first point is taken by left clicking (hold it
down) and the second point is taken from letting go of the left click. 

There are a couple of different modes that can be selected by left clicking an on screen icon.
--------------------------------------------------------
Icon       :   Mode                    :Hotkey
--------------------------------------------------------
Eraser                           :   Undo                      :  U
Eyedropper                       :   Select colour mode        : none
Pencil                           :   Free draw line mode       : none
Line                             :   Line mode                 : none
Paint tin                        :   Paint mode                : none
Box                              :   Filled box mode           : none
Polygon                          :   Square box mode           : none
Circle                           :   Circle mode               : none
Folder                           :   Load or create new file   : none
picture with arrow pointing left :   load previous tile in file:
picture with arrow pointing right:   load next tile in file    :
blank a4 page                    :   create new tile in file   :
disk                             :   save current texture file :
none                             :   load a 16 colour bmp      : shift and l
none                             :   hide bmp , show bmp       : F9
none                             :   end program               : F1 
none                             :   scrolling                 : numpad keys
------------------------------------------------------------------------------------------------
    Mode                :           Explanation
------------------------------------------------------------------------------------------------
Undo                    : Undoes the last action.
Select colour mode      : Left click a point on the screen and the current colour will change to
                        : the point's colour
Free draw line mode     : Hold down left click and drag the mouse to draw the lines.
Line draw mode          : Hold down left click and drag the mouse to the desired position. 
                        : release the button to complete the line.
Paint mode              : The paint mode will only work well if its enclosed in a boundary of 
                        : it;s own colour , such as in the centre of a circle. Be warned that if
                        : it's boundary of it's own colour isn't surrounding the paint point then
                        : the whole screen will be filled by the colour.To paint , left click the
                        : mouse.
Filled box mode         : Hold down left click and drag the mouse to the desired position.                               : Release the button to complete the filled box.
Square box mode         : Same as filled box mode except that it draws a filled square.
Circle mode             : Left click the mouse and drag the mouse before letting it go to set the
                        : radius.
Load or create new file : Loads another .tex file or allows you to create one.
Load next tile in file  : Skips to the next tile in the .tex file so that you can reedit tiles
                        : you previously made.
Load previous tile      : Skips to the previous tile in the .tex file so that you can reedit tiles
                        : you previously made.
Load a 16 colour bmp    : Loads a 16 colour .bmp file into the background so that it can be
                        : traced. 
Hide bmp , show bmp     : This allows you to make the .bmp picture in the background appear and
                        : disappear at will so that you can check on your drawing.
end program             : Ends the program and saves the loaded tile.
 

You can draw tiles bigger than the screen by scrolling using the numpad keys, but the bigger the tile , the slower the game may run.
The more individual lines , boxes and circles in a tile , the more memory the tile will take up and the slower the tile would be in the game.
Remember that when a tile is rendered in the game it is drawn the exact order you drew it, circle by circle and line by line.

The long explanation:
 This version contains 2 gigantic leaps over the previous versions.
Firstly, the game is now rendered in 256 colour glory, so it now
graphically speaking (and only technically) eclipses the original
Sonic on the megadrive. It uses the same level format as version
5, but an inbuilt converter means that levels made for all versions
will run. However, since it uses 256 colours now, the texture format
has changed with the pallette info at the end of the file being extended to cope with the change from 16 to 256 colors. Don't worry about this though coz an inbuilt converter takes care of it. 
   The second leap is more programming orientated. SonicX-treme now contains a console like the one used in quake. I just added it for interests sake, but it should help with level editing.
