CodeWalrus

CodeWalrus Website => Contests => Topic started by: LD Studios on April 29, 2015, 10:13:07 PM

Title: [4x3 contest] Red! Green! Blue!
Post by: LD Studios on April 29, 2015, 10:13:07 PM
My entry for the 4x3, not done yet, but pretty far along.
(https://img.ourl.ca/bloggif_554156907455f.gif)
Lets see if you can tell what it is from the screenshot.
Title: Re: Red! Green! Blue!
Post by: Strontium on April 29, 2015, 10:17:04 PM
Ooh, I think I know what it is!

Shall I tell the world?
Title: Re: Red! Green! Blue!
Post by: Unicorn on April 29, 2015, 10:17:47 PM
Grrrrrrrr. I cn't see it on my kindle. Could you link to the screenie?


Put it in a spoiler
Title: Re: Red! Green! Blue!
Post by: LD Studios on April 29, 2015, 10:18:19 PM
Quote from: Strontium on April 29, 2015, 10:17:04 PM
Ooh, I think I know what it is!

Shall I tell the world?
If you want, I think it's pretty clear though

Quote from: Unicorn on April 29, 2015, 10:17:47 PM
Grrrrrrrr. I cn't see it on my kindle. Could you link to the screenie?
https://img.ourl.ca/bloggif_554156907455f.gif
Title: Re: Red! Green! Blue!
Post by: Strontium on April 29, 2015, 10:19:05 PM
Gotta use the red, green, and blue pixels to get as close to the target color as possible :3
Title: Re: Red! Green! Blue!
Post by: Yuki on April 29, 2015, 10:38:49 PM
Quote from: Strontium on April 29, 2015, 10:19:05 PM
Gotta use the red, green, and blue pixels to get as close to the target color as possible :3
Looks like it, nice one.
Title: Re: Red! Green! Blue!
Post by: Dream of Omnimaga on April 30, 2015, 03:40:07 AM
Ooh, I think I know what it is. I assume you have to press enter as soon as the color contrast is identical to the final block?

You might want to remove the spaces between blocks, though :P (unless that's an emulator bug?)
Title: Re: [4x3 contest] Red! Green! Blue!
Post by: Strontium on April 30, 2015, 03:43:36 AM
I sent him a message about that. We were using the same method to get the block size right. Here is the code we use (I hope this small snippet is okay to share :P)

pixelW = platform.window:width()/4
pixelH = platform.window:height()/3


Of course, when drawn, with this code:
gc:fillRect(x*pixelW, y*pixelH, pixelW, pixelH) the weird decimals you get after dividing the width and height draw things oddly.

The solution? Round the values!
pixelW = math.ceil(platform.window:width()/4)
pixelH = math.ceil(platform.window:height()/3)
Title: Re: Red! Green! Blue!
Post by: Dream of Omnimaga on April 30, 2015, 03:52:35 AM
Keep in mind that you must not use other people's code, as the rules says, though. I guess one tiny routine is fine since, after all, we allow people to use Doors CSE8 BASIC libs, which were written by Kerm, but just making sure that people won't fill their game with other people's code. I am unsure if such entry would be disqualified, but if it wins then it's possible that the other person that provided code for you would win the prize and the contest instead of you. :P

I would also avoid posting code if I was you.
Title: Re: Red! Green! Blue!
Post by: Unicorn on April 30, 2015, 05:45:57 AM
tr1p1ea also wrote those libs right...
Title: Re: Red! Green! Blue!
Post by: Dream of Omnimaga on May 01, 2015, 05:11:27 AM
Yeah true and Iambian wrote some Celtic libraries IIRC.
Title: Re: Red! Green! Blue!
Post by: Unicorn on May 02, 2015, 05:20:51 PM
I can't express how helpful those have become for me.  All my games would look like junk without them!
Title: Re: Red! Green! Blue!
Post by: Dream of Omnimaga on May 02, 2015, 05:56:17 PM
On the 83+ we don't need them thankfully, due to faster screen refreshing and dual-layer ASCII support, but on the CSE ASCII just looks weird without color IMHO.
Title: Re: Red! Green! Blue!
Post by: LD Studios on May 03, 2015, 05:08:58 PM
(let's not get too off topic on my contest thread...) :P
Title: Re: [4x3 contest] Red! Green! Blue!
Post by: Ivoah on May 04, 2015, 01:51:14 PM
This looks great LD!
Title: Re: [4x3 contest] Red! Green! Blue!
Post by: Strontium on May 11, 2015, 12:45:09 AM
I had an idea for this:
HSL mode!
Title: Re: Red! Green! Blue!
Post by: LD Studios on May 11, 2015, 01:46:33 AM
Quote from: Strontium on May 11, 2015, 12:45:09 AM
I had an idea for this:
HSL mode!
I was already considering this, not sure yet whether I want to do it though, especially because of how easy it would be. Saturation is a bit tricky, but Hue and Lightness are way to easy to see just by looking at the target color. I think RGB is a more interesting challenge, and also much easier to implement :P
Title: Re: [4x3 contest] Red! Green! Blue!
Post by: Strontium on May 12, 2015, 02:54:40 AM
HSL mode could be like an easy mode.

Anyways, for hue you would just display whatever hue at max saturation and brightness
Saturation would use the hue, and go from gray to MAXIMUM VIVIDNESS
And lightness would go black to white.