INSTALL
To download, paste this into your computer
pastebin get M6TPyV60 install
GETTING STARTED (READ ME DANG YOU!):
(real tutorial coming soon)
Spoiler
Step 1: Once you have downloaded the install file, run it. It will install the necessary components, and delete itself.Step 2: To start a brand new program, run the file 'cc2d' (no quotes)
That will bring you to a screen where you enter your new program name.
Once done, you will be presented with your 3 basic functions of CC2D
function load() - Called once when the program is ran, where you declare variables and such
function update() - Callback function used to update the state of the game every frame.
function draw() - Callback function used to draw on the screen every frame.
"X, I've tried to run my program, but it's not doing anything! HALP MEH D:!!111!Asdasjdnk"
RUNNING YOUR PROGRAM:
Spoiler
Step 3: To run your CC2D program, type 'cc2d <program name>'So far, there is only 1 API called graphics, it's referenced automatically so you don't have to import it every time you write a new program
Graphics methods
graphics.setColor(color) - [b]sets draw color[/b]
graphics.print(text,x,y) - [b]prints text to screen at x,y -(WIP)[/b]
graphics.circle(x,y,radius) - [b]draws circle at x,y with given radius[/b]
graphics.rectangle(x,y,width,height) - [b]draws rectangle at x,y (origin top left) with given width,height[/b]
graphics.line(startX,startY,endX,endY) - [b]draws line from two given points (same as paintutils.drawLine, added for consitency)[/b]
graphics.pixel(x,y) - [b]draws a pixel at x,y[/b]
CC2D core methods
load() --REQUIRED!
update() --REQUIRED!
draw() --REQUIRED!
keyPressed(key) --Not required, called automatically when a key is pressed (if the method exists)
mouseClicked(button, x, y) --Not required, called automatically when the mouse is clicked (if the method exists)
Some 'gotchas' to be aware of:
- Much like Love2d, graphics API does not work outside of the draw method.
- Due to limits of CC, CC2D runs at 20 fps
- Not recommended for server usage
(probably more soon)
Example!
Once you've installed CC2d, you can also download this sample program I wrote real quick. Make a nice size monitor like so.
Download this
pastebin get usuk7uwr demo
Then run
monitor right cc2d demo
CC2D is making baby steps. Suggestions are welcome!
Post games or demos you make, and I may add them to this post
Release Changes:
Spoiler
[i]V0.02 (Baby Steps)[/i]
+ Added keyboard and mouse support
* Bug Fixes
[i]V0.01 (Early Stages)[/i]
* Initial Release
+ Added Graphics API
+ Added Everything else..