Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

How to generate random images?

Like cryptokitties.co they generate a random image every time. How does this work? 

Having a template of images and adding layers/colours on top or?
It’s not random at all.
There are certain head pieces and body pieces. Just an array of parts and then selecting one from each part.
(Dec 10, 2017 05:02 PM)Charger Wrote:  It’s not random at all.
There are certain head pieces and body pieces. Just an array of parts and then selecting one from each part.

And they have just drawn all the masses amount of parts? I was thinking that's the only logical explanation. 

They must have a fair few parts and just use a program to generate random colours and shit. 

its cool af.
This is a fairly basic thing to do in PHP I think.


I will try making it and if I do I'll explain what I did, I have an idea how to do this but I might be wrong.

Nowadays? I'm just here for the nostalgia.
Every part of the cat is its own piece, by this they can randomly generate different models, if you look closely their body seems to look the same on every cat, but the eyes, patterns, head etc change.
Then there is also random coloring, not much harder than that, I assume each cat is stored with its different parts, think of it as a sprite.
Please do share the logic here If anyone experiments on it.
(Dec 11, 2017 02:48 AM)johnyclubman Wrote:  Please do share the logic here If anyone experiments on it.

There is no logic. It’s just sleecting from arrays of data.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by Ashish BishtOct 23, 2016 11:20 AM 8 351 Oct 23, 2016 11:20 AM
Last Post: F3nrir
[PHP] by CodeBinaryApr 16, 2016 03:27 PM 33 788 Apr 16, 2016 03:27 PM
Last Post: sarciszewski
[PHP] by CodeBinaryDec 13, 2015 01:11 AM 2 145 Dec 13, 2015 01:11 AM
Last Post: ASLR