C-Lesh and SMW Engine Wiki
C-Lesh is a game programming language for 2D games.
Brought to you by:
francois-cdev
Welcome to your wiki!
This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
The wiki uses Markdown syntax.
C-Lesh and Super Mario World Engine
Overview
C-Lesh is a programming language similar to BASIC and C. In C-Lesh all memory is fixed and, therefore, not memory allocation/collection is needed. Also because of the way memory is formatted there is not need for pointers/references. C-Lesh is tailored towards some serious 2D game development like, for example, creating a platform game similar to Super Mario World. With its built-in camera handling and collision detection you'll definitely have what you need when you need it!
The Super Mario World engine is another story. Originally developed in C++, then C, and finally C-Lesh, it is a game engine built for isometric/arcade/platform game development. This is all with code. All you need is a sprite sheet and this engine bundled with C-Lesh. The Super Mario World engine is event-based so game behaviors and even screen actions are handled by events. With this engine you can definitely do it!
History of C-Lesh and Super Mario World engine
Before C-Lesh I was writing games in C++. I tried to make everything as object-oriented and clean as possible. This went well for a while until I went back to work on my first large game (Bluejay's Quest). The code was ugly, complex, and just plain stupid so I posted the project on SourceForge in hope that someone would take over the project - turns out people did not like the code.
In an effort to redeem my first game I decided to implement the project in C using data structures and pointers. Turns out the code was simpler and maintainable. My first game met with success and I wrote another game in C with even more success! However, one problem remained - memory. If you are not careful in C you can overwrite memory and cause your program to behave weirdly. This is when I turned my efforts into writing my own language for game development.
C-Lesh was born from a project which I worked on years back and was to be a close implementation for TI-BASIC but for games. All output was to be text-based with ascii sprites. I took this project and developed it into a usable programming language for 2D games.
The Super Mario World engine was originally written in C++ and was stripped from my first game, Bluejay's Quest. It was buggy and collision detection was wrong! I reimplemented it in C and used it in another game called "Trail Hogs". Worked well. As C-Lesh came about in terms of development I decided to reimplement the engine in C-Lesh but this time making it event-based.
Why C-Lesh? I use it because it is simple and less error prone that other languages/technologies I have used so far. All memory is fixed into object-oriented global arrays which eliminates the need to referencing and overuse of subroutine parameters. Without this worry I am free to create games and spend less time debugging them. Second, C-Lesh ports nicely to other platform via Allegro 5, a game library which also ports to devices like the iPhone and Android phones.
What is C-Lesh written in?
The C-Lesh compiler has always been written in Perl, namely because the parsing is a lot easier to do in this language that in say C++ or even Python! I rewrote this compiler many times to reflect the current evolution of C-Lesh.
C-Lesh compiles into C-Lesh Intermediate Code (CIC). This code is platform/device independent and interpreted. It is executed by the C-Lesh virtual machine and runs inside of the C-Lesh environment just as it would inside of a console. To run a game two files are needed - the CIC and the PNG files. These correspond to the program and graphics chips on the original Nintendo console (NES). Yes, there was a separate chip with programming code and a separate graphics chip with the graphics.
Last edit: Francois C-Dev 2013-04-08