Terrain generator

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Terrain generator

Post by GijsB »

it uses this technic =

0)make 2 points
1)go through all the points
2)make a new point in the middle of 2 points
3)change the hight of that new point with some number, we call it now = Ratio. so we do like :

Code: Select all

hight = hight+math.random(-Ratio,Ratio)
4)change the Ratio to Ratio/2
5)begin by step 1

you can change the smoothness with 'a' and 'b'
(sorry if im making to much threads 3:)
Attachments
terrain generator.love
(537 Bytes) Downloaded 209 times
User avatar
kraftman
Party member
Posts: 277
Joined: Sat May 14, 2011 10:18 am

Re: Terrain generator

Post by kraftman »

Bad argument #2 to 'random' (interval is empty)
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Terrain generator

Post by GijsB »

kraftman,

huge tip = never change smoothness to zero
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Terrain generator

Post by tentus »

GijsB wrote:kraftman,

huge tip = never change smoothness to zero
You, as the author, should code in a fix for that, rather than being rude to someone trying to help you out. Also, I glanced at the code: you should work on polishing. I've attached a version that I polished a bit for you: little things like changing the controls to up/down and lowercasing all the variable names, big things like changing smoothness to be whole numbers (to avoid floating point errors) and moving function definitions outside of other functions, good-habit things like checking user input and putting startup variables into love.load
Attachments
terrain_generator.love
(524 Bytes) Downloaded 134 times
Kurosuke needs beta testers
User avatar
Ensayia
Party member
Posts: 399
Joined: Sat Jun 12, 2010 7:57 pm

Re: Terrain generator

Post by Ensayia »

Also, it's a good idea to tell the users how to control your program. It was not until tentus uploaded his version that I figured out what to do.

I hate having to figure out controls for myself. If you want us to test your stuff at the very least provide us with some information.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Terrain generator

Post by Robin »

Ensayia wrote:I hate having to figure out controls for myself. If you want us to test your stuff at the very least provide us with some information.
Actually, he said which controls to use. Only he had it wrong. It was not 'a' and 'b', but 'a' and 'd'. I would have expected it to be up/down too.
Help us help you: attach a .love.
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Terrain generator

Post by GijsB »

Robin, thanks for clearing that out. And i was not my purpose to be mean to kraftman, it's just how you read the line, you know.

But people, back on-topic, what do you think of it?
User avatar
Trappingnoobs
Citizen
Posts: 95
Joined: Tue Oct 12, 2010 8:52 pm

Re: Terrain generator

Post by Trappingnoobs »

I think it's cool but I think you should make it so if you hold down the buttons for, say, a second, it starts shooting the number up at a stupidly fast speed :-D
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Terrain generator

Post by GijsB »

trappingnoobs, good idea :)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests