¿Nos pondrías por favor el código para poder orientarnos un poco mas?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
1
Preguntas y respuestas / Re:[Ayuda] Crear planta por la que sube Mario.
Octubre 05, 2014, 09:10:26 PM2
Preguntas y respuestas / Re:problema con enemigo
Octubre 17, 2013, 02:07:56 AM
Mira... podes utilizar la variable x del tile... osea, en el evento steep del enemigo pones el codigo que diga..
esto es, si el enemigo pasa sobre el tile... si el tile enemigo esta a la misma altura, usa un collision_rectangle
fijate si te sirve :)
Citarif (x==tile enemigo.x){
direction+=180} //cambiaria de direccion...
esto es, si el enemigo pasa sobre el tile... si el tile enemigo esta a la misma altura, usa un collision_rectangle
Citarif(collision_rectangle(x1,y1,x2,y2,tile enemigo,1,1)) {// x1,y1,x2,y2 son las coordenadas del rectangul ode colision, tendria que tener el tamaño del enemigo +1 aprox
direction+=180}
fijate si te sirve :)
3
Preguntas y respuestas / Re:¿Cómo quitar la selección de celdas?
Octubre 16, 2013, 10:50:53 PM
Mira, mi forma de aprender siempre fue, quiero hacer esto... ok que necesito... esto, aquello, lo otro... y voy cosa por cosa, buscando soluciones... así empece a aprender lenguaje C, pero orientado a microcontroladores... lo mismo hice con GML... Pero si vos pensas que te podes llegar a agobiar, entonces si intenta apuntar un poco mas bajo.
si este tema de los array es la base de tu juego, te puedo dar una mano a entenderlas y poder usar grillas, no te bajes de un proyecto al primer obstáculo :)!
Ya sabes, cualquier cosa, pega un chiflido y se te da una mano! :)
si este tema de los array es la base de tu juego, te puedo dar una mano a entenderlas y poder usar grillas, no te bajes de un proyecto al primer obstáculo :)!
Ya sabes, cualquier cosa, pega un chiflido y se te da una mano! :)
4
Preguntas y respuestas / Re:¿Cómo quitar la selección de celdas?
Octubre 16, 2013, 12:38:05 AM
Tambien estan las grids, que tienen un manojo de funciones para su control.
basicamente, es como te decia Mgbu, un array dentro de otro array! :)
Citards_grid_create(w,h) Creates a new grid with the indicated width and height. The function returns an integer as an id that must be used in all other functions to access the particular grid.
ds_grid_destroy(id) Destroys the grid with the given id, freeing the memory used. Don't forget to call this function when you are ready with the structure.
ds_grid_copy(id,source) Copies the grid source into the grid with the given id.
ds_grid_resize(id,w,h) Resizes the grid to the new width and height. Existing cells keep their original value.
ds_grid_width(id) Returns the width of the grid with the indicated id.
ds_grid_height(id) Returns the height of the grid with the indicated id.
ds_grid_clear(id,val) Clears the grid with the given id, to the indicated value (can both be a number or a string).
ds_grid_set(id,x,y,val) Sets the indicated cell in the grid with the given id, to the indicated value (can both be a number or a string).
ds_grid_add(id,x,y,val) Add the value to the indicated cell in the grid with the given id. For strings this corresponds to concatenation.
ds_grid_multiply(id,x,y,val) Multiplies the value to the indicated cell in the grid with the given id. Is only valid for numbers.
ds_grid_set_region(id,x1,y1,x2,y2,val) Sets the all cells in the region in the grid with the given id, to the indicated value (can both be a number or a string).
ds_grid_add_region(id,x1,y1,x2,y2,val) Add the value to the cell in the region in the grid with the given id. For strings this corresponds to concatenation.
ds_grid_multiply_region(id,x1,y1,x2,y2,val) Multiplies the value to the cells in the region in the grid with the given id. Is only valid for numbers.
ds_grid_set_disk(id,xm,ym,r,val) Sets all cells in the disk with center (xm,ym) and radius r.
ds_grid_add_disk(id,xm,ym,r,val) Add the value to all cells in the disk with center (xm,ym) and radius r.
ds_grid_multiply_disk(id,xm,ym,r,val) Multiply the value to all cells in the disk with center (xm,ym) and radius r.
ds_grid_set_grid_region(id,source,x1,y1,x2,y2,xpos,ypos) Copies the contents of the cells in the region in grid source to grid id. xpos and ypos indicate the place where the region must be placed in the grid. (Can also be used to copy values from one place in a grid to another.)
ds_grid_add_grid_region(id,source,x1,y1,x2,y2,xpos,ypos) Adds the contents of the cells in the region in grid source to grid id. xpos and ypos indicate the place where the region must be added in the grid. (id and source can be the same.)
ds_grid_multiply_grid_region(id,source,x1,y1,x2,y2,xpos,ypos) Multiplies the contents of the cells in the region in grid source to grid id. xpos and ypos indicate the place where the region must be multiplied in the grid. (id and source can be the same.) Only valid for numbers.
ds_grid_get(id,x,y) Returns the value of the indicated cell in the grid with the given id.
ds_grid_get_sum(id,x1,y1,x2,y2) Returns the sum of the values of the cells in the region in the grid with the given id. Does only work when the cells contain numbers.
ds_grid_get_max(id,x1,y1,x2,y2) Returns the maximum of the values of the cells in the region in the grid with the given id. Does only work when the cells contain numbers.
ds_grid_get_min(id,x1,y1,x2,y2) Returns the minimum of the values of the cells in the region in the grid with the given id. Does only work when the cells contain numbers.
ds_grid_get_mean(id,x1,y1,x2,y2) Returns the mean of the values of the cells in the region in the grid with the given id. Does only work when the cells contain numbers.
ds_grid_get_disk_sum(id,xm,ym,r) Returns the sum of the values of the cells in the disk.
ds_grid_get_disk_min(id,xm,ym,r) Returns the min of the values of the cells in the disk.
ds_grid_get_disk_max(id,xm,ym,r) Returns the max of the values of the cells in the disk.
ds_grid_get_disk_mean(id,xm,ym,r) Returns the mean of the values of the cells in the disk.
ds_grid_value_exists(id,x1,y1,x2,y2,val) Returns whether the value appears somewhere in the region.
ds_grid_value_x(id,x1,y1,x2,y2,val) Returns the x-coordinate of the cell in which the value appears in the region.
ds_grid_value_y(id,x1,y1,x2,y2,val) Returns the y-coordinate of the cell in which the value appears in the region.
ds_grid_value_disk_exists(id,xm,ym,r,val) Returns whether the value appears somewhere in the disk.
ds_grid_value_disk_x(id,xm,ym,r,val) Returns the x-coordinate of the cell in which the value appears in the disk.
ds_grid_value_disk_y(id,xm,ym,r,val) Returns the y-coordinate of the cell in which the value appears in the disk.
ds_grid_shuffle(id) Shuffles the values in the grid such that they end up in a random order.
ds_grid_write(id) Turns the data structure into a string and returns this string. The string can then be used to e.g. save it to a file. This provides an easy mechanism for saving data structures.
ds_grid_read(id,str) Reads the data structure from the given string (as created by the previous call).
basicamente, es como te decia Mgbu, un array dentro de otro array! :)
5
Preguntas y respuestas / Re:Proeblema con un array
Octubre 15, 2013, 11:20:44 AM
jaja sisi lo hice yo, quería un código que generara un terreno aleatorio cada vez que arranque la room jajaja, igual tengo que seguir trabajando para que tenga mas variaciones
estuve viendo muchas cosas, una de ellas era que el tamaño de la room no era múltiplo de 16, pequeño problema, acomode eso y varias cosas empezaron a funcionar mejor... con el tema del grass lo pude solucionar simplemente sacando el ultimo if y colocando directamente el codigo
con esto, apenas termina de asignar la ultima variable, la que sigue es "3" que despues se convierte en "obj_grass" Muchísimas gracias por tu ayuda :D
estuve viendo muchas cosas, una de ellas era que el tamaño de la room no era múltiplo de 16, pequeño problema, acomode eso y varias cosas empezaron a funcionar mejor... con el tema del grass lo pude solucionar simplemente sacando el ultimo if y colocando directamente el codigo
Código [Seleccionar]
for(xx=0;xx<=total_x;xx+=1){ //determina si el bloque es piedra, tierra, o pasto, asignando valores 1,2, o 3 a cada celda
cont=0
for(yy=total_y;yy>=0;yy-=1){
if(cont<array_x[xx]){
if(ds_grid_get(global.grid_id,xx,yy+1)==2 or ds_grid_get(global.grid_id,xx-1,yy)==2){ // si, hay una piedra cercana, hay mas probabliddades de que sea piedra tambien
stone=choose(1,2,3,4)
if(stone==1){
ds_grid_set(global.grid_id,xx,yy,2)}
else{
ds_grid_set(global.grid_id,xx,yy,1)}
cont+=1}
else{
stone=choose(1,2,3,4,5,6,7,8) //si no hay piedra cercana, hay menos probablididades de que sea piedra
if(stone==1){
ds_grid_set(global.grid_id,xx,yy,2)}
else{
ds_grid_set(global.grid_id,xx,yy,1)}
cont+=1}}}
ds_grid_set(global.grid_id,xx,total_y-array_x[xx]-1,3)} // termina de generar las variables y a la ultima le
// asigna 3, osea obj_grass
con esto, apenas termina de asignar la ultima variable, la que sigue es "3" que despues se convierte en "obj_grass" Muchísimas gracias por tu ayuda :D
6
Preguntas y respuestas / Proeblema con un array (Solucionado)
Octubre 14, 2013, 06:31:59 AM
buenas... el tema es asi, tengo pensado un juego done el terreno sea al mejor estilo terraria, con bloques de 16*16, ya tengo terminado el generador del terreno y esta funcionando bien, excepto por una cosa, al llegar al ultimo bloque tendria que crear un objeto llamado "obj_grass" y no lo hace... dejo el codigo y el archvio del GM para ver si alguien me podria dar una mano
Código [Seleccionar]
//Creación de variables
global.grid_id=ds_grid_create(room_width/16,room_height/16)
ds_grid_clear(global.grid_id,0)
var array_x,total_x,total_y,xx,yy,cont,xx_prev,stone;
total_x=room_width/16
total_y=room_height/16
//Generación de datos
for(xx=0;xx<=total_x;xx+=1){ //Calcula aleatoriamente la cantidad de bloques en cada linea, y la asigna a un array
if(xx==0){
array_x[xx]=random_range(15,21)}
if(xx>0){
array_x[xx]=array_x[xx-1]+random_range(-2,3)
while(array_x[xx]>25){
array_x[xx]=array_x[xx-1]+random_range(-2,3)}}}
for(xx=0;xx<=total_x;xx+=1){ //determina si el bloque es piedra, tierra, o pasto, asignando valores 1,2, o 3 a cada celda
cont=0
for(yy=total_y;yy>=0;yy-=1){
if(cont<array_x[xx]){
if(ds_grid_get(global.grid_id,xx,yy+1)==2 or ds_grid_get(global.grid_id,xx-1,yy)==2){ // si, hay una piedra cercana, hay mas probabliddades de que sea piedra tambien
stone=choose(1,2,3,4)
if(stone==1){
ds_grid_set(global.grid_id,xx,yy,2)}
else{
ds_grid_set(global.grid_id,xx,yy,1)}
cont+=1}
else{
stone=choose(1,2,3,4,5,6,7,8) //si no hay piedra cercana, hay menos probablididades de que sea piedra
if(stone==1){
ds_grid_set(global.grid_id,xx,yy,2)}
else{
ds_grid_set(global.grid_id,xx,yy,1)}
cont+=1}}
if(cont==array_x[xx]){ //la ultima celda deberia ser pasto
ds_grid_set(global.grid_id,xx,yy,3)}}}
//Creación de objetos
for(xx=0;xx<=total_x;xx+=1){
for(yy=total_y;yy>=0;yy-=1){
if(ds_grid_get(global.grid_id,xx,yy)==1){
instance_create(xx*16,yy*16,obj_dirt)}
if(ds_grid_get(global.grid_id,xx,yy)==2){
instance_create(xx*16,yy*16,obj_stone)}
if(ds_grid_get(global.grid_id,xx,yy)==3){
instance_create(xx*16,yy*16,obj_grass)}}}
7
Preguntas y respuestas / Error al querer crear un instancia (Solucionado)
Octubre 14, 2013, 04:05:43 AM
Gente, quiero crear objetos al azar organizados en una grilla, para esto en el evento "room start" de un objeto coloco esto
pero me salta este error
___________________________________________
ERROR in
action number 1
of Other Event: Room Start
for object obj_control:
Creating instance for non-existing object: 16
alguien sabe porque es ?
EDIT: Encontre el error, es instance_create(x,y,obj) y no instance_create(obj,x,y) jajaja
Código [Seleccionar]
var xx,yy,var_createobject
for(xx=0;xx<=40;xx+=1){
for(yy=0;yy<=30;yy+=1){
var_createobject=choose(0,1)
if(var_createobject==1){
instance_create(obj_dirt,xx*16,yy*16)}}}
pero me salta este error
___________________________________________
ERROR in
action number 1
of Other Event: Room Start
for object obj_control:
Creating instance for non-existing object: 16
alguien sabe porque es ?
EDIT: Encontre el error, es instance_create(x,y,obj) y no instance_create(obj,x,y) jajaja
8
Preguntas y respuestas / Re:IA para un juego de carreras
Octubre 13, 2013, 05:05:41 PM
Es facil de resolver... en el evento Step (del auto), pone un codigo que diga
asegurate que el sprite este mirando a la derecha (0 grados), asi segun la direccion que tenga va a orientar la imagen.
Código [Seleccionar]
image_angle=direction
asegurate que el sprite este mirando a la derecha (0 grados), asi segun la direccion que tenga va a orientar la imagen.
9
Preguntas y respuestas / Re:IA para un juego de carreras
Octubre 13, 2013, 04:09:37 PM
Porque decís levitando? no llego a comprender :/
10
Preguntas y respuestas / Re:IA para un juego de carreras
Octubre 13, 2013, 03:24:34 PM
Podes trabajar con paths... creas varios, y que se elija uno aleatoriamente (para darle un poco de variación)... creo que es la solucion mas simple, aunque no serian muy inteligentes jajaja
11
Preguntas y respuestas / Re:!AYUDA URGENTE EN UN JUEGO¡ ¿Como hacer un sistema de variables?
Octubre 13, 2013, 03:02:29 PM
Hay varias formas de hacer eso... si me das un segundo te hago un ejemplo muy básico :)
EDIT: Te dejo adjunto el ejemplo :) si no llegas a entender algo, o no es l oque precisas, me avisas !
EDIT: Te dejo adjunto el ejemplo :) si no llegas a entender algo, o no es l oque precisas, me avisas !
12
Juegos en desarrollo / Re:Zombie Rush v0.2
Octubre 13, 2013, 05:32:27 AM
mmm... gracias por avisar, ya mismo me pongo a ver que paso.
tienen idea si le paso a alguien mas?
tienen idea si le paso a alguien mas?
13
Preguntas y respuestas / Re:Movimiento
Octubre 11, 2013, 01:55:28 AM
Denada! Te funciono? sino te hago un ejemplo...
(un consejito... para la prox, pone en el post el iconito de la version que usas :GM5: :GM6: :GM7: :GM8:, asi podemos saber bien que te puede servir :D)
(un consejito... para la prox, pone en el post el iconito de la version que usas :GM5: :GM6: :GM7: :GM8:, asi podemos saber bien que te puede servir :D)
14
Preguntas y respuestas / Re:Movimiento
Octubre 10, 2013, 10:58:14 PM
Hola Allen... mira lo que vos pedís es bastante fácil, necesitarías crear el objeto del brazo aparte, y en el evento "steep" y agregarle esto
Recorda de poner el origen de la sprite en el punto de rotación del brazo!... cualquier cosa avisa :)
Código [Seleccionar]
image_angle=point_direction(x,y,mouse_x,mouse_y)
Recorda de poner el origen de la sprite en el punto de rotación del brazo!... cualquier cosa avisa :)
15
Juegos en desarrollo / Zombie Rush v0.2
Octubre 10, 2013, 09:04:11 AM
Zombie Rush (alternativo)
![]() Shooter | ![]() GM8 |

El juego será, basicamente, un \"survival\" ... Estas en un almacén y tenes que resistir la horda zombie el mayor tiempo que puedas, para esto tenes que acomodar las cajas para intentar cortarle el paso a tus enemigos.

![]() ![]() ![]() ![]() ![]() Zombie Rush v0.2 Zombie Rush v0.2 (Enlace Alternativo) Versiones Antiguas Zombie Rush v0.1 ![]() Changelog 10 de Octubre (v0.1): Citar |
Changelog 12 de Octubre (v0.2):
Citar
*Zombies re-balanceados (si detectan un bug, o tienen una idea de como mejorarlo, comentenlo plis :) )
*Re-onfigurada velocidad de disparo
*1er Mapa
*Muchos detalles minimos retocados
Cualquier cosa que se les ocurra, por favor comenten, ayudaría muchísimo al desarrollo :)
Gracias por pasar!