Please Note: You don't have to read it all, of course. Just pick out information you need to get an idea of what I mean.
Hey, thanks for the good feedback.
I actually kept thinking about it and well... my vision is getting clearer. :D
Advanced model:The Compiler itself will be available with a toolkit of useful programmes for Game-Development.
We got:
- a code-editor + interpreter + compiler. (all 3 together in one programme)
- a sprite editor (Basically a Painting-Programme which turns pixelgraphics into
lines of code which can be implemented into the programme)
- a simple synthesizer/sequencer (for the creation of low-fi-chiptune
sounds and music. The applications themselves
are not able to play any soundfile other than
those, created in the low-fi-synth. :D )
The applications will consist of a folder with the following files and subfolders:
- the .exe itself: The only way to execute a game.
- subprogramme-subfolder: The compiler can compile .exe-files and .subp-files.
Explanation following...
- sound-subfolder: Contains all sound data. Sounddata is accessible directly
through code in the programme. It is stored in .tis-files.
(the synth/sequencer produces .tis-files) (I just made up
that filetype.
)
- data-file: In this file (probably a .bin?) all variable-data of the
application itself is being stored. The application can edit
it's existing data-file.
About .exe- and .subp-files:.exe files are executable. As some of you probably remember, the TI-calculators allowed executing other programmes using a certain command which could be included in the code itself. So .subp-files are built pretty much like .exe-files except: They can only be executed by the .exe-file itself.
The developer can choose wether he wants to compile a .exe or a .subp when using the compiler/code-editor.
Subprogrammes (.subp) are very helpful things when developing bigger games.
They actually allow "selfmade commands". If the programmer defines some parameters before executing the Subprogramme, he can basically let anything happen.
It also helps keeping the code easy to understand:
If you have to execute a long row of commands, you can simply build a subprogramme which contains them all, name it "functionx.subp" (or how you want to call it) and then include a command into you .exe which tells the machine to run the subprogramme which contains all the commands.
(Note, the code will only be able to use .subp-files which are stored in the application's subprogramme-folder)
The commands and logic:I slightly modified TI-Basic itself so it is even easier to understand, in my opinion.
Since the resources are actually almost "unlimited". (Come on, letting a 3Ghz, 1GB-RAM Computer display graphics with 96x96-monochrome-pixels? My computer's processor is ~600 times faster than a TI83-one) I was able to reduce the amount of different resource-saving-only-commands. I can show of all the commands needed in this post:
(
Important: every new line starts with a ":")
(
Important: the whole language is absolutely caseUNsensitive)
Basic ones:-
+,-,*,/,log(),sin(),cos(),tan(), root(), ^, (, ) (mathematical)
-
# (defines a Variable/String/List-Value/Matrix-Value)
Example 1:
:5 # VARx //The variable x now has the Value 5
Example 2:
:"Hello" # STRtest //The string test now contains the information "Hello"
-
[ and ] (open and close blocks)
(Blocks are parts of If-, Repeat- and While-operations)
Example:
:If(x=5) //If the x-variable has the value 5...
:[
:Stop //stop and close the programme...
:]
-
If() (Starts an if-bracket)
Example: See "[" and "]"
-
Stop (Stops and closes the programme)
Example: See "[" and "]"
-
Return() (Stops a subprogramme and returns to the place the subprogramme was
executed at)
-
Pause (Stops the programme-flow until the user presses the Enter-key)
Example:
:Output(1,1,"Hello World!") //writes "Hello World!" on the screen
:Pause // waiting...
:Stop // Stops and closes the programme
-
wait() (stops the programme-flow for a certain amount of time) (in ms)
-
starttimer() (starts a timer and stores the value in a certain variable)(in ms)
-
stoptimer() (stops the timer of a certain variable)
Example:
:starttimer(VARtest) //starts a timer for the variable "test")
:wait(10000) //waits for 10 secs (10000ms)
:stoptimer(VARtest) //stops the timer of the variable "test")
:output(1,1,Vartest) //displays the variable's value)
-
lbl() (sets a point int the code. the programme returns to lables through
goto()-commands.)
-
goto() (searches for a lable and returns to it)
Example:
:goto(1) //jumps to "lbl(1)"
:lbl(2)
:Stop //stops and closes programme
:lbl(1)
:goto(2) //jumps to "lbl(2)"
-
Repeat() (repeats the commands in the block until the statement in brackets
is true)
Example:
:1 # VARx //assigns the value 1 to the variable "x"
:Repeat(VARx=4)
:[
:VARx+1 # VARx //adds the value 1 to the variable "x"
:]
-
While() (repeats the commands in the block until the statement in brackets
is not true anymore)
Example:
:1 # VARx //assigns the value 1 to the variable "x"
:While(VarX<4)
:[
:VARx+1 # VARx //adds the value 1 to the variable "x"
:]
-
exec() (executes a Subprogramme)
Example:
:exec(SUBPROGRAMME1) //executes subprogramme1.subp (located in the
subprogramme-folder)
-
rand(,) (corresponds with a random value between the two given in the
brackets)
Example:
:rand(1,10) # VARx //assigns a random Value between 1 and 10 to the
variable "x"
Logic and test:-
=, >, <, <=, >= (used in statements for if-, repeat- and while-functions)
Example:
:If(VARx<=10) //if the variable "x" has a value equal to- or smaller than
10...
:[
:Stop //stops and closes programme
:]
-
and, or, xor (used in statements for if-, repeat- and while-functions)
Example:
:If(VARx<=10 and VARy=5) //if the variable "x" has a value equal to-
or smaller than 10 AND the variable "y" has
the value 5....
:[
:Stop //stops and closes programme
:]
Input/Output/Graphics/Sound:-
Output( , , ) (displays a string, variable or a line of charakters on
a certain position of the screen)
Example1:
:Output(1,1,"Hello World!") //Displays "Hello World!". the line of charakters
starts at line 1, column 1
Example2:
:Output(2,3,STRtest) //Displays the String "test". the line of
charakters starts at line 2, column 3
:Output(3,1,VARtest) //Displays the Variables ("test") Value. the line
of charakters starts at line 3, column 1
Note: A charakter consists of 5x7 black and white pixels. The Screen can hold
16x12 Charakters (96x96pixels)
-
Input() (pauses the programme-flow. The player has to input
a string/number and press the enter-key to continue)
Example:
:Input(STRtest) //the player enters a string which will be stored in
the string "test"
-
ClrHome (all pixels on the screen are turning white)
-
BlackHome (all pixels on the screen are turning black)
-
checkkey() (checks if a key is being pressed at the moment and stores
a 0 or a 1 in a certain variable (pressed=1, not pressed=0))
NOTE: There will be a table of values for every keyboard-key.
Example:
:Repeat(VARx=0)
:[
:checkkey(1,VARx) //the variable "x" changes it's value to 1 if the player
presses the Escape-Key (the escape-key has the number "1")
:]
-
pxlon( , ) (turns the pixel of a certain coordinate (x,y) black)
-
pxloff( , ) (turns the pixel of a certain coodinate (x,y) white)
-
pxlchange( , ) (changes the color of a pixel of a certain coordinate)
-
pxltest ( , , ) (checks a pixel of a certain coordinate and saves it's state
(on/off -> 1/0) to a certain variable)
-
startsound() (starts playing a .tis-file from the sound-folder)
-
stopsound() (stops playing a .tis-file from the sound-folder)
Data-management:There are 4 data-types:
- VAR (variables)
- STR (strings)
- LST (list, a 1-dimensional array)
- MTX (matrix, a 2-dimensional array)
Data doesn't have to be defined. If information is assigned to data, it is being defined automatically in the application's datafile.
If data is being mentioned but not defined, it's default value is 0.
Data always has to be named after a certain scheme:
VAR, STR, LST or MTX have to be the first 3 characters of a certain piece of daa.
Lists always have 100 free slots. (1-100)
Matrices always have 100x100 free slots. (1x1-100x100)
One slot equals one variable.
Strings have a maximum of 100 chracters.
In code, lists and matrices are used like this:
Example1:
LSTtest<1> -> stands for one value
Example2:
MTXtest<1,1> -> stands for one value
The virtual screen:The virtual screen consists of 96x96 "pixels".
This equals 16x12 characters.
Sound:No exact ideas yet...