3
[API] CGE - Computercraft Game Engine [v1.2] - Colors!
Started by billysback, Oct 08 2012 09:29 PM
38 replies to this topic
#21
Posted 22 October 2012 - 05:07 PM
For the getting the pixels do you mean return a table containing all of the pixels of the sprite in the correct set up, like in your code?
And for magenta, could you not use purple? (&5)
If not I'll add a new tag for it />
And for magenta, could you not use purple? (&5)
If not I'll add a new tag for it />
#22
Posted 22 October 2012 - 05:10 PM
Yes, as in a table of tables, one for each pixel in the sprite, in the format {x, y, pixelChar}
Purple would probably work fine, but its still nice to have the full range of colors, including purple and brown.
Purple would probably work fine, but its still nice to have the full range of colors, including purple and brown.
#23
Posted 22 October 2012 - 05:18 PM
So you just want the x,y,pixelChar data right?
If so then put this code at around 475 (anywhere in the middle will do)
You might as well add this line as well, I added it in a dev build for AW.
If so then put this code at around 475 (anywhere in the middle will do)
Spoiler
You might as well add this line as well, I added it in a dev build for AW.
Spoiler
#24
Posted 22 October 2012 - 05:21 PM
Thanks, this will help with the piece stacking for my game.
#25
Posted 22 October 2012 - 05:23 PM
also, if you want to add your own custom colors, you can do that easily by editing the getColor() function and adding:
(I will add support for other colors for an upcoming update, I just wanna do a bit more bug testing first />
elseif mctag == "tag" then return colors.colorsomewhere amongst the other lines like that, just so you know />
(I will add support for other colors for an upcoming update, I just wanna do a bit more bug testing first />
#26
Posted 23 October 2012 - 05:47 PM
When I try to run the example (or any program with the CGE functions for that matter) it gives me an error when trying to call cge functions. "Attempt to index ? (a nil value)"
Any ideas why?
Any ideas why?
#27
Posted 23 October 2012 - 06:30 PM
have you properly installed CGE? (into your lua/rom/apis)
#28
Posted 11 November 2012 - 04:29 PM
cool +1 using this in my game
#29
Posted 13 November 2012 - 06:02 AM
Why would you ever make a game engine using only one source file? It's generally a bad idea to have all of your classes(Not REALLY classes) in one single file, as it will easily get cluttered, and it is also confusing when looking at.
I would recommend writing a require() function, and using that.
I would recommend writing a require() function, and using that.
#30
Posted 13 November 2012 - 06:17 AM
I wanted to decrease complication of installation; basically I wanted to only have one source file.
Also, this was created a while a go and I am only going to be updating it if someone finds that there is something wrong with it; which brakes it.
The LAST thing I am going to do is rewrite it, if your looking for something a little bit similar to this but uses classes then go to my Art API...
Also, this was created a while a go and I am only going to be updating it if someone finds that there is something wrong with it; which brakes it.
The LAST thing I am going to do is rewrite it, if your looking for something a little bit similar to this but uses classes then go to my Art API...
#31
Posted 19 June 2013 - 02:37 AM
Now, as you added those things... What about adding a *collision* event ?
If two gaming sprites (Player1 and Pirates) are touching, then the os should get a new event called *collision*, returning the X and Y position WHERE it touched another picture. It's complicated, i know. But if you transform everything into a table, it will be hilariously easy!
If two gaming sprites (Player1 and Pirates) are touching, then the os should get a new event called *collision*, returning the X and Y position WHERE it touched another picture. It's complicated, i know. But if you transform everything into a table, it will be hilariously easy!
#32
Posted 30 March 2014 - 09:27 AM
Screenies are a great way of getting more downloads and feedback, you should post some. Any ways, i will see this because i am working on a game engine as well and i wanted to compare.
--------------------------------------------
I have tested and there is and error line 21 attempt to index nil (in the cgexample program).
I think that its because you are using an api. If you want this game to work to other people i suggest you to do one of those:
Good job anyways.
--------------------------------------------
I have tested and there is and error line 21 attempt to index nil (in the cgexample program).
I think that its because you are using an api. If you want this game to work to other people i suggest you to do one of those:
- Add the api to the installation;
- Implement the api code in the final game code.
Good job anyways.
#33
Posted 30 March 2014 - 03:53 PM
yeah, no pics no clicks. show some games made with it...
#35
#36
Posted 30 March 2014 - 04:40 PM
RoD, on 30 March 2014 - 04:18 PM, said:
Well, API or no API, no pics no clicks applies. It doesnt interest me until I see a pic that changes my mind.. not just this though. That applies to ALL things. (nearly all..)
#37
Posted 30 March 2014 - 05:14 PM
So what you're saying is, you've basically got ADD, good to know...
The point of this API isn't to be a visual aid. It's to make functional game mechanics, as such the functions it offers are far more important to anyone interested in using it.
The point of this API isn't to be a visual aid. It's to make functional game mechanics, as such the functions it offers are far more important to anyone interested in using it.
#38
Posted 30 March 2014 - 05:31 PM
CometWolf, on 30 March 2014 - 05:14 PM, said:
So what you're saying is, you've basically got ADD, good to know...
The point of this API isn't to be a visual aid. It's to make functional game mechanics, as such the functions it offers are far more important to anyone interested in using it.
The point of this API isn't to be a visual aid. It's to make functional game mechanics, as such the functions it offers are far more important to anyone interested in using it.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users