Shock Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 Witam wszystkich makerów!! Otóz tworzę grę na podstawie pacmana i chciałbym aby duszek gonił pacmana ale ten uparcie stoi w miejscu plz HELP me :) Z góry THX :)
Harrrry Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 Do GM jest dołączony przykład pacmana. Zobacz jak tam jest to zrobione :)
Feynorn Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 Witam wszystkich makerów!! Otóz tworzę grę na podstawie pacmana i chciałbym aby duszek gonił pacmana ale ten uparcie stoi w miejscu plz HELP me :) Z góry THX :) Po jakiejś określonej trasie, czy ma omijać ściany i biec za pacmanem?
Darlix Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 w create duszka: if distance_to_object(gracz) <10000 { direction=point_direction(x,y,gracz.x,gracz.y) } i u gracza stwórz collision z duszkiem i wpisz: if candamage=1 { health-=10 candamage=0 alarm[1]=10 }
Shock Opublikowano 8 Lipca 2008 Autor Opublikowano 8 Lipca 2008 Niestety nadal nie działa :(( P.S Damian nie wsadzam tego drugiego kodu bo nie stworzylem dmg tylko lives ;)
Vianom Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 Ale żeś dowalił Damian, przez to będą sobie chodzili przez ściany. Ja radzę użyć mp_potential_step czy jakoś tak
Yoda Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 A ja radze użyć siatki. Od czego jest Motion Planing w GM'ie?
Darlix Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 chciałem napisać że to źle będzie ale mi prądu brakło i się komp zresetował... ale przecież może zrobić duszkowi collision z scianą i da tam skrypt: move_bounce_solid(1) na jedno wyjdzie... EDIT@ zrób tak jak Yoda napisał...
Yoda Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 chciałem napisać że to źle będzie ale mi prądu brakło i się komp zresetował... ale przecież może zrobić duszkowi collision z scianą i da tam skrypt: move_bounce_solid(1) na jedno wyjdzie... Nie. będzie syf, dziadostwo, gówno! Do takich gier jak pacman nie używa się zwykłych systemów poruszania, tylko takich opartych na siatce ;/
Shock Opublikowano 8 Lipca 2008 Autor Opublikowano 8 Lipca 2008 Yoda a mógłbyś podać mi to w kodzie (jestem totalnym n00bem xD dopiero uczy mnie Feynorn)
Darlix Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 @Yoda a ty masz GM 6.1?? bo ja nie mogę znaleźć tej siatki...
Yoda Opublikowano 8 Lipca 2008 Opublikowano 8 Lipca 2008 @Yoda a ty masz GM 6.1?? bo ja nie mogę znaleźć tej siatki... W GM 6.1 jets motion planning. Yoda a mógłbyś podać mi to w kodzie Nie ;/ Ale mogę ci podac stronę w dokumentacji z której możesz sie uczyć. O, Proszę: Dział Motion Planning: The actual functions for the grid-based approach are as follows: mp_grid_create(left,top,hcells,vcells,cellwidth,cellheight) This function creates the grid. It returns an index that must be used in all other calls. You can create and maintain multiple grid structures at the same moment. left and top indicate the position of the top-left corner of the grid. hcells and vcells indicate the number of horizontal and vertical cells. Finally cellwidth and cellheight indicate the size of the cells. mp_grid_destroy(id) Destroys the indicated grid structure and frees its memory. Don't forget to call this if you don't need the structure anymore. mp_grid_clear_all(id) Mark all cells in the grid to be free. mp_grid_clear_cell(id,h,v) Clears the indicated cell. Cell 0,0 is the top left cell. mp_grid_clear_rectangle(id,left,top,right,bottom) Clears all cells that intersect the indicated rectangle (in room coordinates). mp_grid_add_cell(id,h,v) Marks the indicated cell as being forbidden. Cell 0,0 is the top left cell. mp_grid_add_rectangle(id,left,top,right,bottom) Marks all cells that intersect the indicated rectangle as being forbidden. mp_grid_add_instances(id,obj,prec) Marks all cells that intersect an instance of the indicated object as being forbidden. You can also use an individual instance by making obj the id of the instance. Also you can use the keyword all to indicate all instances of all objects. prec indicates whether precise collision checking must be used (will only work if precise checking is enabled for the sprite used by the instance). mp_grid_path(id,path,xstart,ystart,xgoal,ygoal,allowdiag) Computes a path through the grid. path must indicate an existing path that will be replaced by the computer path. xstart and ystart indicate the start of the path and xgoal and ygoal the goal. allowdiag indicates whether diagonal moves are allowed instead of just horizontal or vertical. The function returns whether it succeeded in finding a path. (Note that the path is independent of the current instance; It is a path through the g rid, not a path for a specific instance.) mp_grid_draw(id) This function draws the grid with green cells being free and red cells being forbidden. This function is slow and only provided as a debug tool.
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się