schrotflinten einstellung?

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

  • schrotflinten einstellung?

    hi, ich habe ein kleines problem:
    ich möchte mit meiner schrotflinte 5 kugeln abschießen (einen in die mitte des fadenkreuzes (maus), links, rechts, oben und unten.jeweils um 7 einheiten versetzt. ich kopiere mal bisher die objekt information:

    Quellcode

    1. Information about object: waffe03sg
    2. Sprite: Waffe03SG
    3. Solid: false
    4. Visible: true
    5. Depth: 0
    6. Persistent: false
    7. Parent: <no parent>
    8. Mask: <same as sprite>
    9. Create Event:
    10. execute code:
    11. gunReady = true;
    12. turretDirection = 0;
    13. targetDirection = 0;
    14. Alarm Event for alarm 0:
    15. execute code:
    16. gunReady = true;
    17. Step Event:
    18. execute code:
    19. targetDirection = point_direction(x, y, ziel.x, ziel.y);
    20. direction = targetDirection
    21. image_single = direction * image_number / 360;
    22. if (mouse_check_button(mb_left)) {
    23. if (gunReady) {
    24. myBullet = instance_create(x, y, schrotkugel);
    25. myBullet.direction = direction;
    26. myBullet.speed = 15;
    27. myBullet.image_single = direction * myBullet.image_number / 360;
    28. myBullet.alarm[0] = point_distance(x, y, ziel.x, ziel.y) / myBullet.speed;
    29. gunReady = false;
    30. alarm[0] = 10;
    31. }
    32. }
    33. End Step Event:
    34. execute code:
    35. waffe03sg.x = x;
    36. waffe03sg.y = y
    37. Keyboard Event for Y-key Key:
    38. destroy the instance
    39. create instance of object waffe06fw at position (0,0)
    Alles anzeigen
    :) Nobody is perfect (-:

    "Dummköpfe sind Denkerköpfen weit überlegen. Zahlenmäßig." Ernst Ferstl
  • Hmm...ich geb dir mal nen Kleinen Tipp...beschreibe dein problem...möglichst ausführlich und detailgetreu...

    ich könnte jetzt auch nen thread aufmachen und sagen : "Ich will ein SChlagzeug"
    nur weiss dann keiner, dass ich nicht genug geld dafür habe und, das das mein Problem ist...
  • OK ich versuche es mal besser zu erklären,
    imoment schiesst die flinte nur eine kugel ab(in die mitte des fadenkreuzes). ich möchte aber das insgesamt 5 kugeln abgeschossen werden die in verschiedene richtungen fliegen, nämlich: in die mitte des fadenkreuzes, fadenkreuz_x+7, fadenkreuz_x-7, fadenkreuz_y+7, fadenkreuz_y-7, nur habe ich keine ahnung wie ich das in den code einbaue.
    :) Nobody is perfect (-:

    "Dummköpfe sind Denkerköpfen weit überlegen. Zahlenmäßig." Ernst Ferstl
  • Das muss im stzep event stehen...also ich hoff ich habe dich richtig verstanden...

    Quellcode

    1. targetDirection = point_direction(x, y, ziel.x, ziel.y);
    2. direction = targetDirection
    3. image_single = direction * image_number / 360;
    4. if (mouse_check_button(mb_left)) {
    5. if (gunReady) {
    6. myBullet = instance_create(x, y, schrotkugel);
    7. myBullet.direction = direction;
    8. myBullet.speed = 15;
    9. myBullet.image_single = direction * myBullet.image_number / 360;
    10. myBullet.alarm[0] = point_distance(x, y, ziel.x, ziel.y) / myBullet.speed;
    11. direction = point_direction(x, y, ziel.x+7, ziel.y);
    12. myBullet = instance_create(x, y, schrotkugel);
    13. myBullet.direction = direction;
    14. myBullet.speed = 15;
    15. myBullet.image_single = direction * myBullet.image_number / 360;
    16. myBullet.alarm[0] = point_distance(x, y, ziel.x+7, ziel.y) / myBullet.speed;
    17. direction = point_direction(x, y, ziel.x, ziel.y+7);
    18. myBullet = instance_create(x, y, schrotkugel);
    19. myBullet.direction = direction;
    20. myBullet.speed = 15;
    21. myBullet.image_single = direction * myBullet.image_number / 360;
    22. myBullet.alarm[0] = point_distance(x, y, ziel.x, ziel.y+7) / myBullet.speed;
    23. direction = point_direction(x, y, ziel.x-7, ziel.y);
    24. myBullet = instance_create(x, y, schrotkugel);
    25. myBullet.direction = direction;
    26. myBullet.speed = 15;
    27. myBullet.image_single = direction * myBullet.image_number / 360;
    28. myBullet.alarm[0] = point_distance(x, y, ziel.x-7, ziel.y) / myBullet.speed;
    29. direction = point_direction(x, y, ziel.x, ziel.y-7);
    30. myBullet = instance_create(x, y, schrotkugel);
    31. myBullet.direction = direction;
    32. myBullet.speed = 15;
    33. myBullet.image_single = direction * myBullet.image_number / 360;
    34. myBullet.alarm[0] = point_distance(x, y, ziel.x, ziel.y-7) / myBullet.speed;
    35. direction = point_direction(x, y, ziel.x, ziel.y);
    36. gunReady = false;
    37. alarm[0] = 10;
    38. }
    39. }
    Alles anzeigen