User blog:IAmAPersson/SimpleC intro to objects (yay!)

Okay guys! Today will be an intro to objects (AKA sprites) in SimpleC! We are getting into harder commands now, so this tutorial will be harder. First off, all object commands will start with OBJCT followed by a period, and then the command. The (full) command to place an object is OBJCT.SET. Time for some syntax: Yay! Advanced stuff! Now to tell what all these do. This command works only with constants. control number is what is assigned to this specific object. Any commands from now on that affect this object will start with this object's control number. This allows for a TON of objects to be displayed at once, and complete control of each of them separately. X coord is where the object will be placed on the X axis, and same for Y. The object net number is what type of object to be set. There are 10 different types of objects, ranging from 0-9. Now that we know what each of these do, lets set an object (type 4) with a control number of 1 at coordinates 20,50: There. Now to move an object. Syntax: There. Now lets move object 1 that we set earlier to coordinates 70,35. This command uses variables instead of constants, so we'll have to do this: Easy-peasy. One more command I want to throw out; GOTO and labels. These serve the same functions they do in SmileBASIC. To go to a specific part of the code. Here's an example: There. Now we can make a simple program where you can move an object around the screen using the D-Pad/Circle Pad: OBJCT.SET[1,0;0,0] SETV VAR[1]=1 LOOP: WHEN BUT[]=1 DO{ MATH Y=Y-1 } WHEN BUT[]=2 DO{ MATH Y=Y+1 } WHEN BUT[]=4 DO{ MATH X=X-1 } WHEN BUT[]=8 DO{ MATH X=X+1 } OBJCT.MOV[1,X;Y] WHEN BUT[]=16 DO{ STOP ELSE{ GOTO LOOP }} You can move the set object around the screen with the D-Pad/Circle Pad and exit the program with A. This simple program makes use of a lot of the commands we've learned. Tomorrow we'll make an actual game. Yes. A full-out game.