SonicX-treme V(8) by J.B. October 2001.
(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.
Install into any directory but make sure that all the *.bmp files are in the sub directory pics.

Note!!! - If you have an ems error, read Sonic_EMS.txt
Contents:
-What's new
-Send in your levels
-Overview of utilities

What's new
--A new rendering process is used for sonicx. Previous versions of sonicx drew each tile using primitives such as line and paint, and repeated the drawing using primitives for as many instances that there are of a particular tile. In this version, the first instance of a tile is drawn using primitives, but it is immediatly copied into an array using GET. Every other occurence of the tile other then the first is drawn by PUT(ing) the array saved by GET to each coordinate necessary for the specified tile.
--This process speeds up rendering considerably, in the order of 200% for some cases.
--An unexpected sideaffect of this new process is that several graphical anomolies present in the previous version of this game have now been fixed. Many people will notice that this version can support exquisite backgrounds. This just wasn't possible in previous versions.
--Every picture in the game is an animation!!!
--Most animations only have one frame, and hence are more like pictures, but if you open up the *.tex(graphics) file in the graphics editor, you can add some extra frames to the picture to make it a free flowing animation.
--The graphics format is completely new, extremely complex, but backwards compatible. If you run an old *.tex file through the graphics editor, an inbuilt converter will upgrade the tex file to version #8 format. I don't think that any other quickbasic program is this backwards compatible!
--The graphics editor is simply the most complex paint program i have ever written. It lets you trace a 256 colour bitmap, automatically adjusting the bitmap's pallete so that it matches the pallete of the tex file. It outputs in tex format, bitmap format or native qbasic. It also has a copy and paste function which happens to be incredibly useful for creating animations.

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, but please note that due to memory issues, not all levels will run under qb4.5. But if you compile the code, the executable should run. 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



SonicX.exe
This runs *.lvl files of version 8 standard and is a very 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%

v8 revisions:
*-*Every picture is an animation
*-*In every graphics plane for each frame, a buffer is created which holds the drawing coordinates for each picture, provided that the coordinates are inside the screen. Each picture may have an unlimited number of coordinates, for example, the grass picture in "green.lvl" may be drawn 30 times at a particular point in the game, and thus it has 30 coordinates. Anyway, each picture is physically drawn only once per graphical plane for each frame. After the picture is drawn, it is temporarily held in another buffer, and lightning fast PUT statements are used to draw the pictures at each of the other coordinates. This has resulted in a amazing speed increase as previously, each picture was physically drawn at each cooridinate at the same time.
*-*New rendering format has fixed the paint anomally. Painted backgrounds are a possibility.
*-*Main sprite has an axis that is perpendicular to the plane of the platform that the sprite is supported by.
*-*shield now works.
*-*engine is much faster.
*-*code is cleaner.

v7 revisions:
The counters are now the correct color. 
speed increase
 -I managed to find a bottleneck. It has been elimanated.
Some of the old collision detection functions have been improved
There are some new collision detection functions
 -updraft effect
 -horizontal wall
 -loop the loop- yes we now have a loop the loop function

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 cooltest.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.

Tileadd.exe
This program can combine animations of many different tex files into one tex file.

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

LevBuild.exe allows you to create a level of sonic the hedgehog by using the tiles you made in the graphics 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 LevBuild.exe to start, it requires that at least one .tex file has been made using Graphics.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 (vertical)       : none
W and line   :   Wall mode (horizontal)     : none
L and circle :   Loop mode                  : none
U and block  :   Loop mode                  : none
C and curve  :   Not operational            : 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         :   Previous tile              : F7
none         :   Load a midi                : m
none         :   Zoom in                    : +
none         :   Zoom out                   : -
none         :   Hide toolbar               : f10
------------------------------------------------------------------------------------------------
    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.
Horizontal Wall mode      : In this mode you can set a wall that sonic can't jump through. For                             : instance, you might want to have a wall that connects to a platform                            : so that sonic can't jump under the platform. To use it , left click                            : the first point of the horizontal line and hold the button until you                           : find a suitable second point.
updraft mode              : Allows you too create a wind tunnel that will drag sonic upwards. To
                          : implement it, left click the first point of a box and move the
                          : mouse around until your happy with the dimensions of the box. then
                          : let go of the mouse button.
loop the loop mode        : Allows you to create a loop the loop that sonic can walk through. It
                          : is essentially a circle, so to implement it, left click at the
                          : centre of the loop and move the mouse around until your happy
                          : with the radius of the loop. Then let go of the mouse button.
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 , do this ;
1, run sonicx.exe and choose the level in the file selector

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


Graphics.exe
Texture editor Version 8 :2001
Usage:
Graphics.exe [(texture file).tex]
This program creats texture files of that can be run in LevBuild.exe
Graphics.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. 

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 left curved arrow   :   load previous frame       :
picture with right curved arrow  :   load next frame           :
picture with left straight arrow :   load previous animation   :
picture with right straight arrow:   load next animation       :
blank a4 page                    :   create new frame          :
a4 page with green block         :   create new animation      :
dotted rectangle                 :   Copy & selection tool     :
none                             :   load a 256 colour bmp     : shift and l
none                             :   save .bas testfile        : e
none                             :   Select next colour        : F2
none                             :   Select previous colour    : F3
none                             :   toggle gridstep           : F5
none                             :   centre picture            : F6
none                             :   Change background colour  : F7
none                             :   Hide drawing, show drawing: F8
none                             :   hide bmp , show bmp       : F9
none                             :   Hide Toolbar              : F10
none                             :   end program               : ESC 
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 animation     : Skips to the next animation in the .tex file so that you can reedit                            : animations you previously made.
Load previous animation : Skips to the previous tile in the .tex file so that you can reedit 
                        : animations you previously made.
Load next frame         : Skips to the next frame in the current animation.
Load previous frame     : Skips to the previous frame in the current animation.
Load a 16 colour bmp    : Loads a 256 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.