(use word wrap and full screen)
SonicX-treme V(9) by J.B. July 2002.
-level funtion revision September 2004
-contains Sonicx Level making guide webpage

SonicX levelmaking competition announced
SonicX is almost finished, but the level editing programs have been finished for a while. In order to promote the impending release of the final version SonicX, I am organising a levelmaking competition. The best six levels that land in my email Inbox at sonicx1@gmail.com by the 14th of October will receive a free gmail invite. These invites have only been offered to a small number of test users, and people have sold them over ebay for $60 or more ($U.S.). People are willing to pay this to get the user name of their choice. Gmail has a gigabyte of storage, and has a very fast loading interface, so it will be the way to email in the future. To construct levels read the  Sonicx Level making guide webpage included in this zip file. There are only two rules in this competition. Each level must contain new graphics, and must not be soley recycled from images present in existing levels. Some images may be recycled however, if you so wish. The other rule is that the graphics and level files must be sent to sonicx1@gmail.com by the 14th of October.


www.geocities.com/jo9992/qbasic.html
Please send all correspondence regarding this release to my email
address at prodigy22k@yahoo.com.au.
Install into any directory but make sure that all the *.bmp files are in the sub directory pics.

Note Well
!!!!!!!!!!!!! 
- If you have an ems error, read Sonic_EMS.txtContents:
- This sonicX version uses XMS, and may not work on Windows XP. The final zip file will come with sonic(XP).
!!!!!!!!!!!!!!

Introduction
Welcome to the most customisable Sonic game you are ever likely to come across . 



-What's new
-Send in your levels
-Overview of utilities

What's new
-Graphics program can now import 256 colour bitmaps and store the bitmaps within the graphics file currently loaded. Just Press Shift and I at the same time to load a bitmap. You then select with a mouse the rectangular area of the  bitmap that your interested in. Then you have to enter the name that the picture will take. The program will then convert the bitmap segment on screen into the native tex format.
-Alternatively, you can use the program bmp2texe.exe to put a bitmap picture into a tex file you nominate. just run the program, it's pretty straight forward.
-Leveled.exe now uses a binary file to store texture information 


Send in your levels
Any levels that are sent to my email adress at prodigy22k@yahoo.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


v9 revisions:
*-*Can now import 256 colour bitmaps. This is very important as it means that you can rip graphics from say a genisis emulator and use them in the level editor to create very cool looking levels. This is of course very memory intensive. Which is why...(read next line)
*-*SonicX now uses XMS memory.All the graphics information is stored in xms, and it is either taken out when needed to be stored temporarily in ems, or it is used to draw straight to the screen, depending on available ems memory.This basically means that SonicX can now handle an unlimited amount of huge pictures. You can use 200 320*200 bitmaps in your level, if you want to.




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

Tileadd2.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 that can be run in LevBuild.exe
Graphics.exe allows you to draw tiles to use in the game.
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                             :   Import a 256 colour bmp   : shift and I
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 256 colour bmp    : Loads a 256 colour .bmp file into the background so that it can be
                        : traced. 
Import a 256 colour bmp : Imports a 256 colour bitmap file into the tex file format.
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.