Dark Bit Factory & Gravity

GENERAL => Challenges & Competitions => Topic started by: Optimus on December 25, 2011

Title: [TINYC5] CRA5TASTIC
Post by: Optimus on December 25, 2011
Hi!

I was normally not thinking about taking part in this compo, because I am not familiar with javascript or web developing but right the last two hours I have checked the tutorials and example framework and said why not?

It's not a serious entry, I just wanted to participate in the compo with the most I can do in a limited time. I thought of the title craptastic and then decided cra5tastic to match more the name of the library. Of course I don't mean that the lib is lame, it's only my entry that is crap :)

I really enjoyed my first try in coding anything javascript related. The lib is simple and great, gonna use it in the future too. I just need to familiarize more with javascript and find a debugger :)
Title: Re: [TINYC5] CRA5TASTIC
Post by: benny! on December 25, 2011
You really did this in just 2 hours without having worked with javascript before ? Well, what can I say except - WOW !!! I like it a lot ... nice plasma floor-ceiling stuff with some sprites - runs pretty smooth on my laptop and chrome!

Thanks a lot for taking part and congratz for your first javascript work!
Title: Re: [TINYC5] CRA5TASTIC
Post by: Kirl on December 25, 2011
Really impressive work for 2 hours in a new language!  :o

For the next challenge I'd like to see what you can do when you spend the month on something, don't go so easy on us!  ;D
Title: Re: [TINYC5] CRA5TASTIC
Post by: jace_stknights on December 25, 2011
Yep great piece of work for two hours of work!  :o
Title: Re: [TINYC5] CRA5TASTIC
Post by: neriakX on December 25, 2011
wow, I'm pretty surprised how good that demo is. You did very well! I couldn't do this in 2 days ;)
Title: Re: [TINYC5] CRA5TASTIC
Post by: padman on December 25, 2011
Cool stuff!  :)
Title: Re: [TINYC5] CRA5TASTIC
Post by: combatking0 on December 26, 2011
Excellent demo - I've been coding JS for many years, but I've no idea how to code a plasma effect.

The 3D rotating dots are also convincing.
Title: Re: [TINYC5] CRA5TASTIC
Post by: Kirl on December 27, 2011
Excellent demo - I've been coding JS for many years, but I've no idea how to code a plasma effect.
Alright, I just have to take this, because a plasma is so simple. I'm parroting jim here, but you just need 3 values for the R,G and B that move between 0-255 with some kind of offset between them. Easy with a sine:

Code: [Select]
var R = 127 + 127 * Math.sin( randomCal1 );
var G = 127 + 127 * Math.sin( randomCal2 );
var B = 127 + 127 * Math.sin( randomCal3 );

Now the cool thing is that no matter what you choose to do for randomCal1, 2 or 3, it will always keep between 0 and 255. So just go wild with some semi random calculations using the x and y of the pixel you're setting.

Everlasting respect and elitist status follows naturally!  ;D
Title: Re: [TINYC5] CRA5TASTIC
Post by: jace_stknights on December 27, 2011
yep this is the "official" technique. On oldschool machines, as this way is two hard for the processor, you can use tricks like cycling colors in palettes, and moving backgrounds pre-calculated by these formulas.
Title: Re: [TINYC5] CRA5TASTIC
Post by: Kirl on December 30, 2011
I just noticed that I can see the dots spinning over two different axis, like the optical illusion of a spinning mask which you can see as either concave or convex. Pretty cool! :)
Title: Re: [TINYC5] CRA5TASTIC
Post by: Hotshot on December 30, 2011
Impressive Stuff there and what even more impressive that you have done in 2 hours  :o :clap: