roomübergänge mit tastenproblemen

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

  • roomübergänge mit tastenproblemen

    Bei meinem Jumpnrun Misanthropius habe ich das Problem, dass wenn die Spielfigur den Room wechselt, dass dann die Tastaturabfrage "spinnt". Sie rennt im nächsten Room z.B. nicht mehr weiter, obwohl die Tastatur dafür noch gedrückt ist. Was könnte ich dagegen tun? Ich habe leider keine gefunden, aber gibt es irgendwelche abfragen, die ich bei einem Roomstart einsetzten könnte, damit die Figur noch weiss, welche Tasten noch gedrückt sind?
    PUTREFACTION ////
    ◇ ALIEN BASTARDS ◇ SLY PITCH ◇ SHOVE MASTER ◇

  • Daran habe ich auch schon gedacht, habe aber alles mit Key Event gemacht....

    Das komische ist, dass das Problem nicht jedesmal auftritt. Oder, dass es teilweise nur für eine kurze Zeit auftritt. Kann z.B. sein, dass beim Roomwechsel die figur nicht mehr weiterrennt oder dass sie erst nach einer Verzögerung weiterrennt...
    PUTREFACTION ////
    ◇ ALIEN BASTARDS ◇ SLY PITCH ◇ SHOVE MASTER ◇

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()

  • Nein. an was hast du da genau gedacht, mit dem Wechseln?

    EDIT:

    Falls es hilfreich sein könnte, die Daten zum Spielerobjekt:

    Information about object: human

    Sprite: stand_left
    Solid: false
    Visible: true
    Depth: -2
    Persistent: true
    Parent: <no parent>
    Mask: <same as sprite>

    Create Event:
    set the gravity to 0.3 in direction 270
    set the friction to 0.1
    set variable lr to 0
    set variable groundimpact to 0

    Step Event:
    if relative position (0,1) is collision free for Only solid objects
    set variable groundimpact to 0
    if at relative position (0,0) there is not object swimblock
    set the gravity to 0.3 in direction 270
    else
    set the gravity to 0 in direction 0
    if lr is equal to 0
    set the sprite to jump_left with scale factor 1
    else
    set the sprite to jump_right with scale factor 1
    else
    set the gravity to 0 in direction 0
    if at relative position (0,0) there is object leim
    set variable image_speed to 0.5
    else
    set variable image_speed to 1
    if relative position (-4,0) is not collision free for Only solid objects
    if lr is equal to 0
    set the horizontal speed to 0
    if relative position (4,0) is not collision free for Only solid objects
    if lr is equal to 1
    set the horizontal speed to 0

    Collision Event with object block:
    move in direction direction at most -1 till a contact with solid objects
    if relative position (0,1) is not collision free for Only solid objects
    if groundimpact is equal to 0
    set variable groundimpact to 1
    play sound little_tab; looping: false
    set the vertical speed to 0
    if lr is equal to 0
    set the sprite to stand_left with scale factor 1
    else
    set the sprite to stand_right with scale factor 1
    if relative position (0,-1) is not collision free for Only solid objects
    set the vertical speed to 0
    if relative position (-4,0) is not collision free for Only solid objects
    set the horizontal speed to 0
    move in direction 180 at most -1 till a contact with solid objects
    if relative position (4,0) is not collision free for Only solid objects
    set the horizontal speed to 0
    move in direction 0 at most -1 till a contact with solid objects

    Collision Event with object jump:
    if vspeed is larger than 0
    set the vertical speed to -8
    for other object: set variable image_single to 1
    play sound tub; looping: false
    play sound zzzz; looping: false
    move in direction 270 at most -6 till a contact with solid objects

    Collision Event with object leim:
    if speed is larger than 0
    create instance of object darkyellowparticle1 at relative position (0,0)
    if sound little_tab is playing
    stop sound little_tab
    play sound saft; looping: false

    Collision Event with object swimblock:
    if speed is larger than 1
    set variable speed to speed/1.2

    Keyboard Event for <Left> Key:
    set variable lr to 0
    if relative position (-4,0) is collision free for Only solid objects
    set the sprite to run_left with scale factor 1
    if at relative position (0,0) there is object leim
    set the horizontal speed to -1
    else
    if at relative position (0,0) there is object swimblock
    set the horizontal speed to -1
    else
    set the horizontal speed to -3
    else
    set the horizontal speed to 0
    if relative position (0,1) is not collision free for Only solid objects
    if at relative position (-3,0) there is object box
    set the sprite to runwall_left with scale factor 1
    else
    set the sprite to wall_left with scale factor 1
    move in direction 180 at most -1 till a contact with solid objects
    if relative position (0,1) is not collision free for Only solid objects
    if image_index is equal to 2
    play sound little_tab; looping: false
    if image_index is equal to 8
    play sound little_tab; looping: false

    Keyboard Event for <Up> Key:
    if at relative position (0,0) there is object swimblock
    set the vertical speed to -1

    Keyboard Event for <Right> Key:
    set variable lr to 1
    if relative position (4,0) is collision free for Only solid objects
    set the sprite to run_right with scale factor 1
    if at relative position (0,0) there is object leim
    set the horizontal speed to 1
    else
    if at relative position (0,0) there is object swimblock
    set the horizontal speed to 1
    else
    set the horizontal speed to 3
    else
    set the horizontal speed to 0
    if relative position (0,1) is not collision free for Only solid objects
    if at relative position (3,0) there is object box
    set the sprite to runwall_right with scale factor 1
    else
    set the sprite to wall_right with scale factor 1
    move in direction 0 at most 0 till a contact with solid objects
    if relative position (0,1) is not collision free for Only solid objects
    if image_index is equal to 2
    play sound little_tab; looping: false
    if image_index is equal to 8
    play sound little_tab; looping: false

    Keyboard Event for <Down> Key:
    if at relative position (0,0) there is object swimblock
    set the vertical speed to 1

    Key Press Event for <Escape> Key:
    go to room menu with transition effect <no effect>

    Key Press Event for <Up> Key:
    if relative position (0,1) is not collision free for Only solid objects
    if at relative position (0,0) there is object leim
    set the vertical speed to 0
    repeat next action (block) 11 times
    create instance of object darkyellowparticle1 at relative position (0,0)
    else
    set the vertical speed to -5
    play sound little_tab; looping: false

    Key Release Event for <Left> Key:
    if relative position (0,1) is not collision free for Only solid objects
    set the sprite to stand_left with scale factor 1
    if at relative position (0,0) there is not object swimblock
    set variable hspeed to hspeed/3

    Key Release Event for <Up> Key:
    if at relative position (0,0) there is not object swimblock
    set the vertical speed to vspeed/2

    Key Release Event for <Right> Key:
    if relative position (0,1) is not collision free for Only solid objects
    set the sprite to stand_right with scale factor 1
    if at relative position (0,0) there is not object swimblock
    set variable hspeed to hspeed/3


    :D
    PUTREFACTION ////
    ◇ ALIEN BASTARDS ◇ SLY PITCH ◇ SHOVE MASTER ◇

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()

  • Könnte es am Buffer liegen?
    Vllt. wird er beim Verlassen eines raumes gelöscht.
    Weiß aber nicht genau.
    Face in the wind, we're riding the storm
    We'll stay our course whatever will come
    ~~ Stay (Running) Wild ~~
  • Haben denn andere Leute hier dieses Problem nicht? Ist das speziell ein Problem des GM 5.0? Das komische ist ja, dass es manchmal garnicht auftritt, aber eben die meisste Zeit schon. Und wenn man in einem Sprung den Room wechselt, besteht das Problem ohne ausnahme.
    PUTREFACTION ////
    ◇ ALIEN BASTARDS ◇ SLY PITCH ◇ SHOVE MASTER ◇

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()

  • irgendwo hab ich schonmal von jemandem gehört, der das selbe Problem hatte, wenn ich nur wüsste wo.... Hast du schonmal im offiziellen Forum nachgeforscht?
    Einige meiner Spiele:
  • Es gibt da eine abfrage, die du am anfand des Raumes machen kannst. Im Create Event eines Objectes das nur in diesem Raum ist.

    GML-Quellcode

    1. if (keyboard_check(vk_left)) { Gehe nach links}
    2. if (keyboard_check(vk_right)) { Gehe nach rechts}


    die Key Codes kannst du ind der Hilfe nachlesen. Gamemaker Language/Benutzeinteraktion/Die Tastatur.

    MFG kabuco

    Projektsite: www.kabsoft.de.vu
  • Das ist tatsächlich ein Bug im Gamemaker der seit Version 6 mitgeschliffen wird. Ich hab das selbe problem bei meinem Projekt auch gehabt, letzendlich hab ichs nur mit einem Halbherzigen Workaround gelöst. (Tasten Manuell speichern, im nächsten Raum wieder setzen)
    ...
  • Die Reihenfolge ist falsch, die Variable darf erst wieder gesetzt werden, wenn geprüft wurde.

    Demnach in den Create Event folgendes:

    GML-Quellcode

    1. room_act = room


    Und im Step Event sowas:

    GML-Quellcode

    1. //Prüfen ob raum gewechselt wurde
    2. if (room_act <> room) {
    3. //das machen, wenn gewechselt wurde
    4. //Variable auf aktuellen Raum stellen
    5. room_act = room
    6. }
    "Die Erde ist ein Irrenhaus. Dabei könnte das bis heute erreichte Wissen der Menschheit aus ihr ein Paradies machen. Dafür müsste die weltweite Gesellschaft allerdings zur Vernunft kommen."
    - Joseph Weizenbaum