hola a todos, soy un poco nuevo en esto y hace poco empece un proyecto estilo terraria, ya logre generar el mapa aleatoriamente
solo tengo los sig problemas.
no se como distribuir agua o mas bien que tengan forma de lagos.
no tengo idea de como ocultar los blokes del suelo. osea poner una sombra que los oculte y solo puedan ser vistos cuando entres con una antorcha o cualquier tipo de luz.
estuve buscando scripts pero no he tenido suerte con eso. y soy muy malo para crear algoritmos
aqui el codigo que uso en mi generador:
p=90 // POSITION // START GENERATES FROM THIS HEIGHT //
v=2 // VELOCITY // THIS WILL INCREASE THE HEIGHT BY 2 //
a=-1 // ACCELERATION // THIS WILL DECREASE VELOCITY BY 1 //
// TOP //
for(i=0;i<room_width;i+=32){ // THIS WILL KEEP GENERATE THE WORLD UNTIL IT REACHES ITS END //
//flores aleatori
r=floor(random(30))
if r>15 && r<19{instance_create(i,room_height-(p*32),tree)}//1% chance of tree
if r>0 && r<2{instance_create(i,room_height-(p*32),obj_flower)}//1% chance of flores
if r>3 && r<5{instance_create(i,room_height-(p*32),obj_cow)}//1% chance of cows
instance_create(i,room_height-(p*32),obj_BlockU) // THIS WILL CREATE THE TOP LAYER //
// MIDDLE //
for(m=room_height-((p-1)*32);m<room_height;m+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //
if m<room_height-((p-4)*32){
instance_create(i,m,obj_BlockD)
}
}
// BOTTOM //
for(b=room_height-((p-4)*32);b<room_height;b+=32){ // THIS WILL START GENERATE THE BOTTOM LAYER //
instance_create(i,b,obj_BlockB)
}
p+=v
v+=a
a=choose(-2,-1,0,1,2)
// TERRAIN SHAPE //
if p>80{p=80 v=0 a=-abs(a)}
if p<70{p=70 v=0 a=abs(a)}
}
instance_destroy()
cualquiera cual sea su ayuda estare muy agradecido.
una imagen de mi juego para que se den idea
(http://img199.imageshack.us/img199/9981/6p6g.png)
Mira este:
http://gmc.yoyogames.com/index.php?showtopic=553857 (http://gmc.yoyogames.com/index.php?showtopic=553857)
Preguntas y respuestas: qué es y cómo funciona - Leer antes de postear (http://www.comunidadgm.org/preguntas-y-respuestas/preguntas-y-respuestas-que-es-y-como-funciona-leer-antes-de-postear/)