Mostrar Mensajes

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.

Temas - pippermint

1
Quiero cambiar el tileset dependiendo de algunas condiciones, pero game maker se comporta raro...

mosaico = "tileset"+string(amb);

la variable "amb" es numerica, y la variable mosaico iría aqui :


if terreno = 0 {

for(var i = 0; i < room_height/32; i++)
{
for(var ii = 0; ii <room_width/32; ii++)
{
tile_add(mosaico, 256, 0, 32, 32, ii*32, i*32, 5000);
}
}
}


El problema es que no funciona ( al cambiar la variable amb sigue igual), incluso cuando cambio completamente la variable mosaico, me sigue apareciendo el tileset que he usado antes... es una falla grafica que se arregla borrando caché o el codigo está mal o ambas ?
Gracias  :) :)
2
Hola, tengo este codigo, de la orientación de un enemigo, que en teoria detecta si ha cambiado de posición y lo cambia por su imagen correspondiente.

if (x == xprevious && y == yprevious)
{
    image_speed = 0;
}

if xprevious < x  {
if (image_index <= 9 || image_index >= 12)
        {
            image_index = 9;

}
if xprevious > x  {
if (image_index <= 6 || image_index >=9 )
        {
            image_index = 6;
}
if yprevious < y 
{
if (image_index <= 3 || image_index >= 6)
        {
            image_index = 3;
}
if yprevious > y 
{
if (image_index <= 0 || image_index >= 3)
        {
            image_index = 0;
}
}}}}

el tema es que no detecta que haya un cambio en la x ni en la y, ( y si, se está moviendo ).

Este es el codigo en create
hp = 30;
speed = choose ( 0.5,1,1.5)
direccion = choose (0,90,180 )
direction = direccion
image_speed = 0.3 * speed

Step

depth = -y
if (place_meeting(x,y,obj_bala))
{
    var magiaprop
    magiaprop = instance_nearest(x,y,obj_bala);
   
    hp -= global.damage; // **

{
}}

if ( hp < 0 )
{
instance_destroy(){
}}
//pared
if( place_meeting(x,y+ 12,obj_room))  {direction = 90} //arriba
if( place_meeting(x,y - 12,obj_room)) {direction = 270} //abajo
if( place_meeting(x - 12,y,obj_room)) {direction = 0} //izquierda
if( place_meeting(12+x,y,obj_room)) {direction = 180} //derechaa
//pared enemigos
if( place_meeting(x,y+ 12,par_enemy))  {direction = 90} //arriba
if( place_meeting(x,y - 12,par_enemy)) {direction = 270} //abajo
if( place_meeting(x - 12,y,par_enemy)) {direction = 0} //izquierda
if( place_meeting(12+x,y,par_enemy)) {direction = 180} //derechaa

//orientacion


if (x == xprevious && y == yprevious)
{
    image_speed = 0;
}

if xprevious < x  {
if (image_index <= 9 || image_index >= 12)
        {
            image_index = 9;

}
if xprevious > x  {
if (image_index <= 6 || image_index >=9 )
        {
            image_index = 6;
}
if yprevious < y 
{
if (image_index <= 3 || image_index >= 6)
        {
            image_index = 3;
}
if yprevious > y 
{
if (image_index <= 0 || image_index >= 3)
        {
            image_index = 0;
}
}}}}


Muchas gracias !
3
Preguntas y respuestas / Problema en autotile
Febrero 26, 2018, 10:23:13 PM
 :GMS:
Cuanto tiempo sin pasar por aquí ! Ahora que tengo mas tiempo he decidido darle mas horas al juego que estoy creando, bueno, al lío :
Estoy haciendo un script que crea las tiles ( que en realidad son frames de un objeto ) dependiendo de la posición que este el obj_room, el caso es que funciona perfecto excepto algunos bordes de la derecha.


este es el codigo.
image_speed = 0
//Autotile
if( relax = false ) // esto hace que el step pare de buscar los objetos de las cercanias.
{
// da valor de 1 si hay un objeto al lado.
if( place_meeting(x,y+ 48,obj_room))  {ar = 1} //arriba
if( place_meeting(x,y - 48,obj_room)) { ab = 1} //abajo
if( place_meeting(x - 48,y,obj_room)) { iz = 1} //izquierda
if( place_meeting(x + 60,y,obj_room)) {der = 1 } //derecha
// binario ( sin uso)
bin = de + (iz*2) + (ab*4) + (ar*8)

//Tile 0
if( ar = 0) & (ab= 1) & (iz= 0) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 6
}
//Tile 1
if( ar = 0) & (ab= 0) & (iz= 1) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 1
}
//Tile 2
if( ar = 0) & (ab= 0) & (iz= 0) & (de= 1) & !(place_meeting (x,y,obj_room ))
{
image_index = 2
}
//Tile 3
if( ar = 0) & (ab= 1) & (iz= 0) & (de= 1) & !(place_meeting (x,y,obj_room ))
{
image_index = 3
}
//Tile 4
if( ar = 0) & (ab= 1) & (iz= 1) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 7
}
//Tile 5
if( ar = 1) & (ab= 0) & (iz= 0) & (de= 1) & !(place_meeting (x,y,obj_room ))
{
image_index = 5
}
//Tile 6
if( ar = 1) & (ab= 0) & (iz= 0) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 0
}
//Tile 7
if( ar = 1) & (ab= 0) & (iz= 1) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 4
}
//Tile 8
if( ar = 0) & (ab= 0) & (iz= 0) & (de= 0) & !(place_meeting (x,y,obj_room ))
{
image_index = 8
}
//Tile 9
if(place_meeting (x,y,obj_room ))
{
image_index = 9
}
//Tile 10
if( ar = 0) & (ab= 0) & (iz= 0) & (de= 0) & (place_meeting (x,y,obj_room ))
{
image_index = 10
//Tile
if( ar = 1) & (ab= 1) & (iz= 1) & (de= 0) & (place_meeting (x,y,obj_room ))
{
image_index = 8
}}}