Jump to content




[API] CGE - Computercraft Game Engine [v1.2] - Colors!


38 replies to this topic

#21 billysback

  • Members
  • 569 posts

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 :)/>

#22 faubiguy

  • Members
  • 213 posts

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.

#23 billysback

  • Members
  • 569 posts

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)
Spoiler

You might as well add this line as well, I added it in a dev build for AW.
Spoiler


#24 faubiguy

  • Members
  • 213 posts

Posted 22 October 2012 - 05:21 PM

Thanks, this will help with the piece stacking for my game.

#25 billysback

  • Members
  • 569 posts

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:
	    elseif mctag == "tag" then
			    return colors.color
somewhere 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 phyzix5761

  • New Members
  • 7 posts

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?

#27 billysback

  • Members
  • 569 posts

Posted 23 October 2012 - 06:30 PM

have you properly installed CGE? (into your lua/rom/apis)

#28 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 11 November 2012 - 04:29 PM

cool +1 using this in my game

#29 Mads

  • Members
  • 604 posts
  • LocationCopenhagen, Denmark

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.

#30 billysback

  • Members
  • 569 posts

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...

#31 SeniorFight

  • Members
  • 7 posts
  • LocationMinecraft

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!

#32 RoD

  • Members
  • 313 posts

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:
  • Add the api to the installation;
  • Implement the api code in the final game code.
Hope you fix it, because the peaplo that didnt install the CGE can't play the game, wich means: only the game devs can play it. :P
Good job anyways.

#33 sci4me

  • Members
  • 225 posts
  • LocationEarth

Posted 30 March 2014 - 03:53 PM

yeah, no pics no clicks. show some games made with it...

#34 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 30 March 2014 - 03:56 PM

View Postsci4me, on 30 March 2014 - 03:53 PM, said:

yeah, no pics no clicks. show some games made with it...
Really, thats some useless advice. If people need pictures they dont belong here. The documentation should be enough,

#35 RoD

  • Members
  • 313 posts

Posted 30 March 2014 - 04:18 PM

View PostEngineer, on 30 March 2014 - 03:56 PM, said:

View Postsci4me, on 30 March 2014 - 03:53 PM, said:

yeah, no pics no clicks. show some games made with it...
Really, thats some useless advice. If people need pictures they dont belong here. The documentation should be enough,
And it is enough, but images are more atractive and people stay longer and get more interesed in the porgram. :)

#36 sci4me

  • Members
  • 225 posts
  • LocationEarth

Posted 30 March 2014 - 04:40 PM

View PostRoD, on 30 March 2014 - 04:18 PM, said:

View PostEngineer, on 30 March 2014 - 03:56 PM, said:

View Postsci4me, on 30 March 2014 - 03:53 PM, said:

yeah, no pics no clicks. show some games made with it...
Really, thats some useless advice. If people need pictures they dont belong here. The documentation should be enough,
And it is enough, but images are more atractive and people stay longer and get more interesed in the porgram. :)

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 CometWolf

  • Members
  • 1,283 posts

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.

#38 RoD

  • Members
  • 313 posts

Posted 30 March 2014 - 05:31 PM

View PostCometWolf, 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.
Agree.

#39 pfgcomputercraft

  • Members
  • 4 posts

Posted 24 April 2014 - 01:06 AM

View Postbillysback, on 23 October 2012 - 06:30 PM, said:

have you properly installed CGE? (into your lua/rom/apis)
... that's installing it correctly? shouldn't you just use the os.loadAPI function





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users