Switching rooms, problem bei verschidenen grössen

  • GM 8

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Switching rooms, problem bei verschidenen grössen

    Ich habe die Räume so das wenn ich von linken ende gehe komm ich beim nächsten raum von rechts
    das Problem ist das wenn die Räume verschieden gross sind geht es nicht





    Das ist der Code vom Outside Event vom Player


    if y-8 > room_height
    {
    if room_exists(obj_location.south)
    {
    room_goto(obj_location.south)
    y = 0+8
    }
    }
    if y-8 < 0
    {
    if room_exists(obj_location.north)
    {
    room_goto(obj_location.north)
    y = room_height-8
    }
    }
    if x+8 > room_width
    {
    if room_exists(obj_location.east)
    {
    room_goto(obj_location.east)
    x = 0+8
    }
    }
    if x-8 < 0
    {
    if room_exists(obj_location.west)
    {
    room_goto(obj_location.west)
    x = room_width-8
    }
    }




    Das der Raum create Code


    location = instance_create(0,0,obj_location)
    with (location)
    {
    north = -1
    south = -1
    east = -1
    west = -1
    }
  • Weshalb schreibst du "y = 0+8"? 8|

    Mein Ansatz:

    GML-Quellcode

    1. //outside room:
    2. if y<=0 && room_exists(roomNorth)
    3. {
    4. room_goto(roomNorth);
    5. y = room_height;
    6. }
    7. if y>=room_height && room_exists(roomSouth)
    8. {
    9. room_goto(roomSouth);
    10. y = 0;
    11. }
    12. if x<=0 && room_exists(roomWest)
    13. {
    14. room_goto(roomWest);
    15. x = room_width;
    16. }
    17. if x>=room_width && room_exists(roomEast)
    18. {
    19. room_goto(roomEast);
    20. x = 0;
    21. }
    Alles anzeigen


    Sollte funktionieren, selbst wenn die Rooms unterschiedlich groß sind.
    Dieser Beitrag wurde bereits 8.675.628 mal editiert, zuletzt von »levarris07« (Heute, 11:33)
  • Benutzer online 1

    1 Besucher