Skocz do zawartości

Problem z przejściem do następnej planszy


Cygnus

Rekomendowane odpowiedzi

Cześć wszystkim.

 

Mam następujący problem,kiedy chcę przejść do następnej planszy:

 

 

################################################################################

############

FATAL ERROR in

action number 1

of Create Event

for object obj_player:

 

Pop :: Execution Error - Variable set failed phy_fixed_rotation - read only variable?

at gml_Object_obj_player_CreateEvent_1 (line 6) - move_speed = 200;

####################################################################

Odnośnik do komentarza
Udostępnij na innych stronach

Dziwne to,że mam 3 pokoje i te trzy pokoje działają,a ten nie działa:/

O to kod obj_player

 

CREATE

 

 

GML
[/gml]

start_x = x;

start_y = y;

 

phy_fixed_rotation = true;

 

move_speed = 200;

max_xspeed = 2;

jumping = false;

jump_force = -95;

[gml]

Odnośnik do komentarza
Udostępnij na innych stronach

Dzięki chłopaki nie włączyłem fizyki w roomie.

Ale teraz jest taki problem,ok przechodzę do tego pokoju,ale aimacja jest tam straszna..wszystko drastycznie wolno idzie:/ jak ruszam bohaterem,to chwile potrwa za nim zrobi krok.

Kurcze co jest nie tak,Reszta pokojów dobrze działa.

Odnośnik do komentarza
Udostępnij na innych stronach

No chaotycznie się zmienia to fakt..klatki...

Sprzęt mam bardzo dobry,więc to odpada.

 

o to kod obj_player

 

STEP

 

GML
[/gml]

phy_speed_x = max(min(phy_speed_x, max_xspeed) , -max_xspeed);

 

if(phy_speed_x > 0.1 || phy_speed_x < -0.1) {

sprite_index = spr_Player_Running;

 

} else{

sprite_index = sprPlayer;

 

}

if (phy_speed_y > 1.2) {

sprite_index = spr_Player_Falling;

}

 

 

image_speed = phy_speed_x / 10;

 

background_x[0] = -phy_position_x / 5;

background_x[0] = -phy_position_y / 5;

 

 

background_x[1] = -phy_position_x / 5;

background_x[1] = -phy_position_y / 5;[gml]

 

 

CREATE

 

GML
[/gml]

 

start_x = x;

start_y = y;

 

phy_fixed_rotation = true;

 

move_speed = 200;

max_xspeed = 2;

jumping = false;

jump_force = -95;

 

 

 

 

Tu niżej wszystko z obj_playera

 

[gml]

Information about object: obj_player Sprite: sprPlayer

Solid: false

Visible: true

Depth: 0

Persistent: false

Parent:

Mask: spr_wall

Physics

Start Awake: true

Is Kinematic: false

Is Sensor: false

Density: 1

Restitution: 0,1

Group: 0

Linear Damping: 1

Angular Damping: 0,1

Friction: 0,1

Shape: Box

Points:

(3,25, 0)

(30, 0)

(30, 30)

(3,25, 30)

Create Event:

execute code: start_x = x; start_y = y; phy_fixed_rotation = true; move_speed = 200; max_xspeed = 2; jumping = false; jump_force = -95; set the health to 100 Alarm Event for alarm 0:

execute code: ///make this happen Step Event:

execute code: phy_speed_x = max(min(phy_speed_x, max_xspeed) , -max_xspeed); if(phy_speed_x > 0.1 || phy_speed_x < -0.1) { sprite_index = spr_Player_Running; } else{ sprite_index = sprPlayer; } if (phy_speed_y > 1.2) { sprite_index = spr_Player_Falling; } image_speed = phy_speed_x / 10; background_x[0] = -phy_position_x / 5; background_x[0] = -phy_position_y / 5; background_x[1] = -phy_position_x / 5; background_x[1] = -phy_position_y / 5; if health is smaller than 1 jump to the start position restart the game Collision Event with object obj_Collision:

execute code: ///make this happen Collision Event with object obj_kamien:

execute code: ///make this happen Collision Event with object obj_centralnyPrawy:

execute code: ///make this happen Collision Event with object obj_kolce:

set the health relative to -5 Collision Event with object obj_enemy:

set the health relative to -1 Collision Event with object obj_skosikowy:

execute code: ///make this happen Collision Event with object obj_platformaTrawaM:

execute code: ///make this happen Collision Event with object obj_skosikP:

execute code: ///make this happen Collision Event with object obj_woda:

set the health relative to -5 Collision Event with object obj1:

execute code: ///make this happen Collision Event with object obj2:

execute code: ///make this happen Collision Event with object obj3:

execute code: ///make this happen Collision Event with object obj4:

execute code: ///make this happen Collision Event with object obj5:

execute code: ///make this happen Collision Event with object obj6:

execute code: ///make this happen Collision Event with object obj7:

execute code: ///make this happen Collision Event with object obj8:

execute code: ///make this happen Collision Event with object obj9:

execute code: ///make this happen Collision Event with object obj10:

execute code: ///make this happen Collision Event with object obj11:

execute code: ///make this happen Collision Event with object obj12:

execute code: ///make this happen Collision Event with object obj13:

execute code: ///make this happen Collision Event with object obj14:

execute code: ///make this happen Collision Event with object obj15:

execute code: ///make this happen Collision Event with object obj16:

execute code: ///make this happen Collision Event with object obj17:

execute code: ///make this happen Collision Event with object obj18:

execute code: ///make this happen Collision Event with object obj19:

execute code: ///make this happen Collision Event with object obj20:

execute code: ///make this happen Collision Event with object obj21:

execute code: ///make this happen Collision Event with object obj22:

execute code: ///make this happen Collision Event with object obj23:

execute code: ///make this happen Collision Event with object obj24:

execute code: ///make this happen Collision Event with object obj25:

execute code: ///make this happen Collision Event with object obj26:

execute code: ///make this happen Collision Event with object obj27:

execute code: ///make this happen Collision Event with object obj28:

execute code: ///make this happen Collision Event with object obj29:

execute code: ///make this happen Collision Event with object obj30:

execute code: ///make this happen Collision Event with object obj31:

set the health relative to -5 Keyboard Event for Key:

execute code: image_xscale = -1; physics_apply_force(x,y, -move_speed, -20); Keyboard Event for Key:

execute code: image_xscale = 1; physics_apply_force(x,y, move_speed, -20); Other Event: Outside Room:

execute code: phy_position_x = start_x; phy_position_y = start_y; if next room exists Go to next room Draw GUI Event:

execute code: draw_text(0,0,"Fps:"+string(fps)+"/"+string(room_speed)) Key Press Event for Key:

execute code: ///First Jump if (place_meeting(x,y+1, obj_Collision)) { jumping = true; alarm [0] = 1; physics_apply_impulse(x,y,0, jump_force); show_debug_message("First Jump") } execute code: /// Secound Jump if(jumping && alarm[0] < 0){ physics_apply_impulse(x,y,0, jump_force); jumping = false; show_debug_message("Double Jump") }

GML
Odnośnik do komentarza
Udostępnij na innych stronach

Proszę Panie Uzjel;)

 

Kurcze nie wiem,co jest nie tak,te 3 pokoje działają bardzo dobrze,a ten ostatni wyciąga 2 lub 4 klatki:/ maks:/

Kolizje pousuwałem z objektami to dalej nie pomaga:/

 

 

Obj_Player

 

 

CREATE

GML
[/gml]

 

start_x = x;

start_y = y;

 

phy_fixed_rotation = true;

 

move_speed = 200;

max_xspeed = 2;

jumping = false;

jump_force = -95;

[gml]

 

STEP

 

GML
[/gml]

 

phy_speed_x = max(min(phy_speed_x, max_xspeed) , -max_xspeed);

 

if(phy_speed_x > 0.1 || phy_speed_x < -0.1) {

sprite_index = spr_Player_Running;

 

} else{

sprite_index = sprPlayer;

 

}

if (phy_speed_y > 1.2) {

sprite_index = spr_Player_Falling;

}

 

 

image_speed = phy_speed_x / 10;

 

background_x[0] = -phy_position_x / 5;

background_x[0] = -phy_position_y / 5;

 

 

background_x[1] = -phy_position_x / 5;

background_x[1] = -phy_position_y / 5;

[gml]

 

Outside Room

GML
[/gml]

 

phy_position_x = start_x;

phy_position_y = start_y;

[gml]

Draw Gui

GML
[/gml]

 

draw_text(0,0,"Fps:"+string(fps)+"/"+string(room_speed))

 

[gml]

 

Tu całe info z show information

 

GML
[/gml]

Information about object: obj_player Sprite: sprPlayer

Solid: false

Visible: true

Depth: 0

Persistent: false

Parent:

Mask: spr_wall

Physics

Start Awake: true

Is Kinematic: false

Is Sensor: false

Density: 1

Restitution: 0.1

Group: 0

Linear Damping: 1

Angular Damping: 0.1

Friction: 0.1

Shape: Box

Points:

(3.25, 0)

(30, 0)

(30, 30)

(3.25, 30)

Create Event:

execute code: start_x = x; start_y = y; phy_fixed_rotation = true; move_speed = 200; max_xspeed = 2; jumping = false; jump_force = -95; set the health to 100 Alarm Event for alarm 0:

execute code: ///make this happen Step Event:

execute code: phy_speed_x = max(min(phy_speed_x, max_xspeed) , -max_xspeed); if(phy_speed_x > 0.1 || phy_speed_x < -0.1) { sprite_index = spr_Player_Running; } else{ sprite_index = sprPlayer; } if (phy_speed_y > 1.2) { sprite_index = spr_Player_Falling; } image_speed = phy_speed_x / 10; background_x[0] = -phy_position_x / 5; background_x[0] = -phy_position_y / 5; background_x[1] = -phy_position_x / 5; background_x[1] = -phy_position_y / 5; if health is smaller than 1 jump to the start position restart the game Collision Event with object obj_Collision:

execute code: ///make this happen Collision Event with object obj_kamien:

execute code: ///make this happen Collision Event with object obj_centralnyPrawy:

execute code: ///make this happen Collision Event with object obj_kolce:

set the health relative to -5 Collision Event with object obj_enemy:

set the health relative to -1 Collision Event with object obj_skosikowy:

execute code: ///make this happen Collision Event with object obj_platformaTrawaM:

execute code: ///make this happen Collision Event with object obj_skosikP:

execute code: ///make this happen Collision Event with object obj_woda:

set the health relative to -5 Collision Event with object obj23:

execute code: ///make this happen Collision Event with object obj31:

set the health relative to -5 Keyboard Event for Key:

execute code: image_xscale = -1; physics_apply_force(x,y, -move_speed, -20); Keyboard Event for Key:

execute code: image_xscale = 1; physics_apply_force(x,y, move_speed, -20); Other Event: Outside Room:

execute code: phy_position_x = start_x; phy_position_y = start_y; if next room exists Go to next room Draw GUI Event:

execute code: draw_text(0,0,"Fps:"+string(fps)+"/"+string(room_speed)) Key Press Event for Key:

execute code: ///First Jump if (place_meeting(x,y+1, obj_Collision)) { jumping = true; alarm [0] = 1; physics_apply_impulse(x,y,0, jump_force); show_debug_message("First Jump") } execute code: /// Secound Jump if(jumping && alarm[0] < 0){ physics_apply_impulse(x,y,0, jump_force); jumping = false; show_debug_message("Double Jump") } [gml]</span>

Odnośnik do komentarza
Udostępnij na innych stronach

Proszę Panowie..tu link do mojej gry

Zerknijcie,co jest nie tak,teraz coś poknociłem i wcześniej działał w żółwim tempie ten ostatni pokój,a teraz już błąd wywala:/

I jak możecie zobaczcie jak to zrobić,że jak przechodzi do drugiego roomu,to w konkretnym miejscu,a nie,gdzie się obróci na koniec planszy,to może przejść bezproblemowo do następnego roomu.

 

Tu link do mojej gry

 

Odwiedź moją stronę

Odnośnik do komentarza
Udostępnij na innych stronach

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ę
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...