Ich verzweifle grad irgendwie an meinem Projekt( 2d multiplayer side shooter) nachdem ich nun mit großer Mühe die eineige Features richtig eingebaut hab muss ich mir das grundsystem irgendwie zerschossen haben . Genauergesagt meine Spieler wollen sich nicht mehr richtig bewegen z.b kleben sie am boden und wenn man springt springen sie bis zur decke und kleben daran nur in der luft lassen sie sich noch ein wenig steuern . Das seltsame ist : ich habe die codes mit einer alten version verglichen wo z.b die physik synchronisation noch nicht drinn war und dort läuft alles , obwohl die codes die selben sind. auch im singleplayer geht mit ähnlichren codes und den selben objekten(plattformen etc alles) ich weiß wirklich nicht wo ich noch suchen soll.
hier mal die information aus meinem multiplayer player vieleicht kann jemand den fehler finden
Spoiler anzeigen
Alles anzeigen
hier mal die information aus meinem multiplayer player vieleicht kann jemand den fehler finden
GML-Quellcode
- Information about object: obj_player_self
- Sprite: player01 right
- Solid: false
- Visible: true
- Depth: -1
- Persistent: false
- Parent: obj_player_parent
- Mask: <same as sprite>
- Create Event:
- set the sprite to player01 right with subimage 0 and speed 0
- set variable look to 1
- set variable leben to 50
- set variable tod to 0
- set variable last_hit to 10
- set Alarm 1 to 30
- execute code:
- xstart = x
- ystart = y
- Alarm Event for alarm 0:
- execute code:
- //Update position
- clearbuffer();
- writebyte(2);
- writebyte(global.myid);
- writeshort(x);
- writeshort(y);
- writeshort(sprite_index);
- writeshort(image_speed);
- writeshort(image_index);
- sendmessage(global.clienttcp);
- //Redo it
- alarm[0] = 1;
- execute code:
- clearbuffer();
- writebyte(22);
- writebyte(global.myid);
- writeshort(leben);
- writebyte(last_hit)
- sendmessage(global.clienttcp);
- Alarm Event for alarm 1:
- set variable leben relative to 5
- if leben is larger than 50
- set variable leben to 50
- set Alarm 1 to 90
- Step Event:
- if relative position (0,1) is collision free for Only solid objects
- set the gravity to 1 in direction 270
- else
- set the gravity to 0 in direction 270
- if vspeed is larger than 12
- set the vertical speed to 12
- if leben is smaller than 1
- if tod is equal to 0
- create instance of object dead_mp at relative position (0,0)
- set variable visible to false
- set variable tod to 1
- execute code:
- clearbuffer();
- writebyte(23);
- writebyte(global.myid);
- writestring(global.username);
- sendmessage(global.clienttcp);
- Collision Event with object obj_bullet_parent:
- if tod is equal to 0
- execute code:
- clearbuffer();
- writebyte(22);
- writebyte(global.myid);
- writeshort(leben);
- sendmessage(global.clienttcp);
- Collision Event with object explosion kiste:
- if tod is equal to 0
- execute code:
- clearbuffer();
- writebyte(22);
- writebyte(global.myid);
- writeshort(leben);
- writebyte(last_hit)
- sendmessage(global.clienttcp);
- set variable leben relative to -1
- set variable last_hit to 4
- Collision Event with object explosion fass:
- if tod is equal to 0
- execute code:
- clearbuffer();
- writebyte(22);
- writebyte(global.myid);
- writeshort(leben);
- writebyte(last_hit)
- sendmessage(global.clienttcp);
- set variable leben relative to -2
- set variable last_hit to 5
- Collision Event with object water_up:
- if vspeed is larger than 0
- set variable vspeed to vspeed*0.3
- set variable hspeed to hspeed*0.3
- Collision Event with object water:
- if vspeed is larger than 0
- set variable vspeed to vspeed*0.3
- set variable hspeed to hspeed*0.3
- Collision Event with object obj_parent_floor:
- for other object: if leben is smaller than 999
- move in direction 270 at most 12 till a contact with solid objects
- set the vertical speed to 0
- Collision Event with object kiste_ph:
- for other object: if leben is smaller than 999
- move in direction 270 at most 12 till a contact with solid objects
- set the vertical speed to 0
- Collision Event with object Fass_ph:
- for other object: if leben is smaller than 999
- move in direction 270 at most 12 till a contact with solid objects
- set the vertical speed to 0
- Keyboard Event for <Left> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- if relative position (-4,0) is collision free for Only solid objects
- jump relative to position (-5,0)
- Keyboard Event for <Up> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- if relative position (0,16) gives a collision with Only solid objects
- set the vertical speed to -15
- Keyboard Event for <Right> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- if relative position (4,0) is collision free for Only solid objects
- jump relative to position (5,0)
- Other Event: Outside Room:
- if tod is equal to 0
- if y is larger than 64
- set variable leben to 0
- Draw Event:
- execute code:
- draw_sprite_corrected(sprite_index, image_index, x, y, image_xscale, image_yscale, image_angle, image_blend, image_alpha);
- at relative position (0,0) draw the value of: gravity
- Key Press Event for <Space> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- if look is equal to 0
- create instance of object bullet02 at relative position (-13.5,2.51)
- else
- create instance of object bullet02 at relative position (11,2.51)
- Key Press Event for <Left> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- set the sprite to player01 with subimage 0 and speed 0.3
- set variable look to 0
- Key Press Event for <Right> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- set the sprite to player01 right with subimage 0 and speed 0.3
- set variable look to 1
- Key Release Event for <Left> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- set the sprite to player01 with subimage 0 and speed 0
- set variable look to 0
- Key Release Event for <Right> Key:
- for all obj_client: if running is equal to 1
- if tod is equal to 0
- set the sprite to player01 right with subimage 0 and speed 0
- set variable look to 1
