|
[CODE] Tilemap generation based on images
#412958
12/05/12 16:20
12/05/12 16:20
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
OP
Expert
|
OP
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Hi Guys, I came across this code I had once written, figured someone might wanna make use of it. (tested and works with A7 and A8) It's very crude, it reads all images from a folder, and based on that creates blocks (per pixel) that are colored with the image's pixel color. To make any use of it, you'd have to spawn certain tiles based on the RGB values (commented in there too), but it's a start. It stores all the images in an array too, you can load "levels" that way. by default it loads the first image in the array (and will probably crash if there is none, but hey, I told you it was rough code!). Hope someone finds use of it, if I come across more stuff I'll upload it for you all to enjoy Download link: TileCreationImageBased.rar regards,
|
|
|
Re: [CODE] Tilemap generation based on images
[Re: 3run]
#413753
12/17/12 11:14
12/17/12 11:14
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
OP
Expert
|
OP
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Turned out this was rather easy! I have re-uploaded the source (same link as before), it contains 2 new functions. One generates a random level, and the other stores that to an array. Check my comments for more info regards, (PS: loading images was ofcourse already available, but wrapped in a quick function, you'll have to write your own pieces of code based on this to expand it)
|
|
|
Re: [CODE] Tilemap generation based on images
[Re: 3run]
#413761
12/17/12 13:48
12/17/12 13:48
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
OP
Expert
|
OP
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
I found an issue, where the BMAP that is being saved, is not compatible to be loaded again. I will investigate, and if needed file a bug-report. Once I've got it fixed, I'll upload the new files again regards,
|
|
|
|