Noticias

Importante: ¡Si quieres publicar tu juego no olvides leer este tema!

Comunidad Game Maker

Bienvenid@ a la comunidad hispana de Game Maker. Nuestro objetivo es crear videojuegos y dar soporte en castellano de GM. Para mejorar nuestro servicio hemos implantado, como adicion al reglamento general, algunas normas especificas en los subforos más comunes. ¡No olvides informarte antes de participar!.

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - elviskelley

Páginas: 1 2 3 ... 17
1
Preguntas y respuestas / Re:Problema con botones de menu
« en: Junio 23, 2020, 02:38:50 pm »
se comprende muy poco el problema, pero si existen diversidad de maneras de hacer un menu como el que quieres.

2
Preguntas y respuestas / Re:Problemas programando un enemigo
« en: Junio 23, 2020, 02:37:38 pm »
el error esta en que inicias el path sin antes verificar la posicion o  distancia y hasta el camino, antes de iniciar el path coloca una condicion if para verificar si esta el camnino libre y si esta lejos del jugador y repite el codigo en una alarma que se ejecute cada 3 segundos y verifique el camino nuevo y activo o no el path

3
Preguntas y respuestas / Re:MovimientoDeProyectiles
« en: Mayo 15, 2020, 04:02:21 pm »
Mas simple que eso... usa esto en el step
image_angle=direction;
direction+=3
if speed<24 then
{speed+=0.0.1;}
else
{speed=0; x=xstart; y=ystart;}

Te dejo adjunto el ejemplo

4
lo mas rapido es que uses una time_Line con eso lograras lo que quieres sin esfuerzo

5
Preguntas y respuestas / Re:exportar en game maker 8 es legal?
« en: Mayo 15, 2020, 03:47:29 pm »
hay licencias gratis por la web de  :GM6: :GM7: :GM8: se consiguen incluso licencias de GM8 a precios tan bajos como 4$. No hace falta piratearlo.
El  :GMS: Ese si que esta caro, por eso no lo he comprado, cuento con el dinero, pero como ni tiempo tengo para hacer algo no lo he comprado.

6
Preguntas y respuestas / Re:Oscuridad y Lampara
« en: Mayo 10, 2020, 03:25:05 pm »
usa un teñido
draw_set_blend_mode(bm_add)
draw_sprite_ext(spr_Luz,0,x,y,5,5,45,c_white,0.5)
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,image_blend,image_alpha);
draw_set_blend_mode(bm_normal)

el spr_Luz Logico es la lampara y debe ser blanco con tonos grises claros.

7
puede funcionar pero debes tener encuenta que los brazos son sprites distintos al del cuerpo. y lo otro a tomar en cuenta es el xscale segun la direccion.

8
imagino todo eso lo tienes en alguno de event step, y lo peor no vi lo encierres en un bloque de acciones {acciones} Pero, a veces el principal error es que en el step se queda haciendo el cambio de sprite continuo por lo que no avanza del primer subimagen,. por lo cual es bueno siempre comparar si ya posee o no dicho sprite antes de indicar cambiar a ese sprite
ejemplo:
if place_free(x+1, y+1) and sprite_index!=spritePArado then
{sprite_index=spritePArado;}

prueba a ver si se corrige

9
Preguntas y respuestas / Re:hacer juego de estrategia con tildes
« en: Mayo 10, 2020, 03:10:33 pm »
No es dificil, pero la respuesta a tu pregunta si lo es, por que, no haces una pregunta simple de como hago una cuadricula, o como una grilla, o como el movimiento de una grilla limitando espacios. Tu pregunta fue como hago el juego. basicamente quieres que te digamos como crear dicho juego desde el inicio, y eso es muy largo y tedioso como para que alguien quiera tomar tanto tiempo en responderlo.
Lo que si puedo decirte es que si quieres hacerlo leas los articulos sobre inteligencia artificial, la verdad no es complicado. Lo otro es que debes buscar el manual y leer sobre alineacion, y grillas, y sobre todo bajate ejemplos de movimientos izometricos.
necesitas aprender todo estro:
A grid is simply a two-dimensional array. A grid has an integer width and height. The structure allows you to set and retrieve the value of cells in the grid by giving the index of it (which starts with 0 in both the x- and the y-direction). But you can also set the value in regions, add values, and retrieve the sum, max, min, and mean value over a region. The structure is useful to represent e.g. a playing field. Even though all functionality can also be achieved using two-dimensional arrays, the operations on regions are a lot faster. The following functions exist: 

ds_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).

Esto
A list stores a collection of values in a particular order. You can add values at the end or insert them somewhere in the middle of the list. You can address the values using an index. Also you can sort the elements, either in ascending or descending order. Lists can be used in many ways, for example to store changing collections of values. They are implemented using simple arrays but, as this is done in compiled code it is a lot faster than using an array yourself. The following functions are available: 

ds_list_create() Creates a new list. The function returns an integer as an id that must be used in all other functions to access the particular list.
ds_list_destroy(id) Destroys the list with the given id, freeing the memory used. Don't forget to call this function when you are ready with the structure.
ds_list_clear(id) Clears the list with the given id, removing all data from it but not destroying it.
ds_list_copy(id,source) Copies the list source into the list with the given id.
ds_list_size(id) Returns the number of values stored in the list.
ds_list_empty(id) Returns whether the list is empty. This is the same as testing whether the size is 0.
ds_list_add(id,val) Adds the value at the end of the list.
ds_list_insert(id,pos,val) Inserts the value at position pos in the list. The first position is 0, the last position is the size of the list minus 1.
ds_list_replace(id,pos,val) Replaces the value at position pos in the list with the new value.
ds_list_delete(id,pos) Deletes the value at position pos in the list. (Position 0 is the first element.)
ds_list_find_index(id,val) Find the position storing the indicated value. If the value is not in the list -1 is returned.
ds_list_find_value(id,pos) Returns the value stored at the indicated position in the list.
ds_list_sort(id,ascend) Sorts the values in the list. When ascend is true the values are sorted in ascending order, otherwise in descending order.
ds_list_shuffle(id) Shuffles the values in the list such that they end up in a random order.
ds_list_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_list_read(id,str) Reads the data structure from the given string (as created by the previous call).

Esto otro
A do statement has the form 

do <statement> until(<expression>)
The statement (which can also be a block) is executed until the expression is true. The statement is executed at least once. Be careful with your do loops. You can easily make them loop forever, in which case your game will hang and not react to any user input anymore.

Example
The following program tries to place the current object at a free position (this is about the same as the action to move an object to a random position).


{
  do
  {
    x = random(room_width);
    y = random(room_height);
  }
  until (place_free(x,y))
}

Expressions can be real numbers (e.g. 3.4), hexadecimal numbers, starting with a $ sign (e.g. $00FFAA), strings between single or double quotes (e.g. 'hello' or hello) or more complicated expressions. (Note that strings can run over multiple lines!) For expressions, the following binary operators exist (in order of priority):
&& || ^^: combine Boolean values (&& = and, || = or, ^^ = xor)
< <= == != > >=: comparisons, result in true (1) or false (0)
| & ^: bitwise operators (| = bitwise or, & = bitwise and, ^ = bitwise xor)
<< >>: bitwise operators (<< = shift left, > > = shift right)
+ -: addition, subtraction
* / div mod: multiplication, division, integer division, and modulo
Note that value of x div y is the value of x/y rounded in the direction of zero to the nearest integer. The mod operator returns the remainder obtained by dividing its operands. In other words, x mod y = x - (x div y) * y. Also, the following unary operators exist:

!: not, turns true into false and false into true
-: negates the next value
~: negates the next value bitwise
As values you can use numbers, variables, or functions that return a value. Sub-expressions can be placed between brackets. All operators work for real values. Comparisons also work for strings and + concatenates strings. (Please note that, contrary to certain languages, both arguments to a Boolean operation are always computed, even when the first argument already determines the outcome.)
Example

Here is an example with some assignments.


{
  x = 23;
  color = $FFAA00;
  str = 'hello world';
  y += 5;
  x *= y;
  x = y << 2;
  x = 23*((2+4) / sin(y));
  str = 'hello' + " world";
  b = (x < 5) && !(x==2 || x==4);
}

In a number of situations you want to let your action depend on a particular value. You can do this using a number of if statements but it is easier to use the switch statement. A switch statement has the following form:

switch (<expression>)
{
  case <expression1>: <statement1>; ... ; break;
  case <expression2>: <statement2>; ... ; break;
  ...
  default: <statement>; ...
}

This works as follows. First the expression is executed. Next it is compared with the results of the different expressions after the case statements. The execution continues after the first case statement with the correct value, until a break statement is encountered. If no case statement has the right value, execution is continued after the default statement. (It is not required to have a default statement.) Note that multiple case statements can be placed for the same statement. Also, the break is not required. If there is no break statement the execution simply continues with the code for the next case statement.

Example
The following program takes action based on a key that is pressed.


switch (keyboard_key)
{
  case vk_left:
  case vk_numpad4:
    x -= 4; break;
  case vk_right:
  case vk_numpad6:
    x += 4; break;
}

A for statement has the form

for (<statement1> ; <expression> ;<statement2>) <statement3>
This works as follows. First statement1 is executed. Then the expression is evaluated. If it is true, statement 3 is executed; then statement 2 and then the expression is evaluated again. This continues until the expression is false.

This may sound complicated. You should interpret this as follows. The first statement initializes the for-loop. The expression tests whether the loop should be ended. Statement2 is the step statement that goes to the next loop evaluation.

The most common use is to have a counter run through some range.

Example
The following program initializes an array of length 10 with the values 1- 10.


{
  for (i=0; i<=9; i+=1) list[i] = i+1;
}

As indicated before, it is possible to read and change the value of variables in other instances. But in a number of cases you want to do a lot more with other instances. For example, imagine that you want to move all balls 8 pixels down. You might think that this is achieved by the following piece of code

ball.y = ball.y + 8;
But this is not correct. The right side of the assignment gets the value of the y-coordinate of the first ball and adds 8 to it. Next this new value is set as y-coordinate of all balls. So the result is that all balls get the same y-coordinate. The statement


ball.y += 8;
will have exactly the same effect because it is simply an abbreviation of the first statement. So how do we achieve this? For this purpose there is the with statement. Its global form is


with (<expression>) <statement>
<expression> indicates one or more instances. For this you can use an instance id, the name of an object (to indicate all instances of this object) or one of the special objects (all, self, other, noone). <statement> is now executed for each of the indicated instances, as if that instance is the current (self) instance. So, to move all balls 8 pixels down, you can type.


with (ball) y += 8;
If you want to execute multiple statements, put curly brackets around them. So for example, to move all balls to a random position, you can use


with (ball)
{
  x = random(room_width);
  y = random(room_height);
}

Note that, within the statement(s), the indicated instance has become the self instance. Within the statements the original self instance has become the other instance. So for example, to move all balls to the position of the current instance, you can type


with (ball)
{
  x = other.x;
  y = other.y;
}

Use of the with statement is extremely powerful. Let me give a few more examples. To destroy all balls you type


with (ball) instance_destroy();
If a bomb explodes and you want to destroy all instances close by you can use


with (all)
{
  if (distance_to_object(other) < 50) instance_destroy();
}

As you should know you can define up to eight different views when designing rooms. A view is defined by its view area in the room and its viewport on the screen (or to be precise in the drawing region within the window). Using views you can show different parts of the room at different places on the screen. Also, you can make sure that a particular object always stays visible.
You can control the views from within code. You can make views visible and invisible and change the place or size of the views in the drawing region or the position and size of the view in the room (which is in particular useful when you indicate no object to be visible). You can change the size of the horizontal and vertical border around the visible object, and you can indicate which object must remain visible in the views. The latter is very important when the important object changes during the game. For example, you might change the main character object based on its current status. Unfortunately, this does mean that it is no longer the object that must remain visible. This can be remedied by one line of code in the creation event of all the possible main objects (assuming this must happen in the first view):


{
  view_object[0] = object_index;
}

The following variables exist that influence the view. All, except the first two are arrays ranging from 0 (the first view) to 7 (the last view).


view_enabled Whether views are enabled or not.
view_current* The currently drawn view (0-7). Use this only in the drawing event. You can for example check this variable to draw certain things in only one view. Variable cannot be changed.
view_visible[0..7] Whether the particular view is visible on the screen.
view_xview[0..7] X position of the view in the room.
view_yview[0..7] Y position of the view in the room.
view_wview[0..7] Width of the view in the room.
view_hview[0..7] Height of the view in the room.
view_xport[0..7] X-position of the viewport in the drawing region.
view_yport[0..7] Y-position of the viewport in the drawing region.
view_wport[0..7] Width of the viewport in the drawing region.
view_hport[0..7] Height of the viewport in the drawing region.
view_angle[0..7] Rotation angle used for the view in the room (counter-clockwise in degrees).
view_hborder[0..7] Size of horizontal border around the visible object (in pixels).
view_vborder[0..7] Size of vertical border around visible object (in pixels).
view_hspeed[0..7] Maximal horizontal speed of the view.
view_vspeed[0..7] Maximal vertical speed of the view.
view_object[0..7] Object whose instance must remain visible in the view. If there are multiple instances of this object only the first one is followed. You can also assign an instance id to this variable. In that case the particular instance is followed.


Note that the size of the image on the screen is decided based on the visible views at the beginning of the room. If you change views during the game, they might no longer fit on the screen. The screen size though is not adapted automatically. So if you need this you have to do it yourself, using the following functions:


window_set_region_size(w,h,adaptwindow) Set the width and height of the drawing region in the window. adaptwindow indicates whether the window size must be adapted if the region does not fit in. The window size will always be adapted if you use fixed scaling. (See the function window_set_region_scale().)
window_get_region_width() Returns the current width of the drawing region.
window_get_region_height() Returns the current height of the drawing region.

In a game you often need the position of the mouse cursor. Normally you use for this the variables mouse_x and mouse_y. When there are multiple views, these variables give the mouse position with respect to the view the mouse is in. Sometimes though, you might need the mouse position with respect to a particular view, also when it is outside that view. For this the following functions exist.


window_view_mouse_get_x(id) Returns the x-coordinate of the mouse with respect to the view with index id.
window_view_mouse_get_y(id) Returns the y-coordinate of the mouse with respect to the view with index id.
window_view_mouse_set(id,x,y) Sets the position of the mouse with respect to the view with index id.
window_views_mouse_get_x() Returns the x-coordinate of the mouse with respect to the view it is in (same as mouse_x).
window_views_mouse_get_y() Returns the y-coordinate of the mouse with respect to the view it is in (same as mouse_y).
window_views_mouse_set(x,y) Sets the position of the mouse with respect to the first view that is visible.

Creo que si aprendes eso que mencione mas lo basico podras crearlo.
sto debe responder tu duda por completo. No busques hacer algo facil, aprende y has lo que quieres lograr.

10
Preguntas y respuestas / Re:Problema con variables
« en: Mayo 10, 2020, 02:57:58 pm »
no entendi mucho pero cuando se quiere dibujar texto y una variable de valor numerico se hace asi
draw_text(x,y,"Ver.Var: "+string(variable))

11
no es necesario estar colocando codigos , solo usa esto en el event end step
if instance_number(object.Enemigos) < 1
{room_goto_next();}

Es todo...

ahora si quieres que los muestre colocas algo en el draw
draw_text(x,y,instance_number(object.Enemigos));
 

12
Munguia, no solo era un artista costaricense, tambien un colega de la comunidadgm creo varios juegos y artes como la naranja mecanica, que era una naranja que era mecanico. Jaja el siempre con sus cosas, pensamiento liberal y pacifista. Es una lastima, aunque si algo tenemos seguro todos es la muerte, solo espero Dios lo guarde en su gloria.
Aqui el blog del colega Munguia.
https://munguiavideojuegos.blogspot.com/2017/08/naranja-mecanica-el-regreso.html?m=1

13
Preguntas y respuestas / Re:Maquina de Estados en un Plataformero
« en: Febrero 10, 2020, 01:43:26 pm »
El hecho es que no se comprende mucho lo que quieres, por que no dices bajo que condiciones vas a llamarlos estados, cual es la lista de estados que posees, y sobre todo dices algo de las animaciones, asi que no se si se trata solo del cambio de sprite según estado.
llamar en un plataformas claro que es distinto por la diferencia que en un cenital, izometrico, básicamente tienes las direcciones por grados sus 360. mientras que en el plataformas solo tienes 2 direcciones derecha e izquierda, para verificar hacia arriba, debes tomar en cuenta 2 situaciones, 1 si sube sobre una plataforma, 2 si sube por que ha saltado. Esto sin agregar que existen otras opciones como usar jet pack, u otrasituacion para subir que se te ocurra, lo cual la animacion seria distinta para cada caso, y el cambio de sprite, velocidad de sub imagenes, y hasta la sub imagen actual, serian cosas a tomar en cuenta.
el movimiento hacia abajo, va tambien con verificaciones, como si estas sobre una plataforma bajando, y es caida controlada con jet pack, o si cae por gravedad. para lo cual debes establecer condiciones.
Yo prefiero los cambios de sprite se llamen en el event End step y en unas cuantas lineas de codigos definir todos los cambios de sprite.
algo igual podrias hacer con los estados, realizar un solo script que compare cada situacion y active un estado u otro y desactive los no necesarios.

14
Noticias / Re:GIA 01 La carrera de los droides
« en: Enero 26, 2020, 01:06:00 pm »
donde descargo el editable para GMS1

15
Intercambio / Re:¿Alguien que quiera hacer algo conmigo?
« en: Enero 13, 2020, 04:45:26 pm »
con gusto te ayudo... Me sirve de entretenimiento.
Escribeme a mi E-Mail; elviskelley@gmail.com
No soy musico... Lo otro lo hago todo jajaja

Páginas: 1 2 3 ... 17