Frage zu einem Script

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

  • Frage zu einem Script

    Bei folgendem Script habe ich ein Problem ( das Script ist, wie man unten lesen kann, nicht von mir)
    Manchmal, geht der Schuss, der da gedrawt wird durch die gegner durch, aber nur manchmal.


    GML-Quellcode

    1. /////////////////////////////////////////////
    2. // This script is created by Jan Kaleta //
    3. // [EMAIL]ganjashaman@seznam.cz[/EMAIL] //
    4. // [URL]www.kaletoviny.wz.cz[/URL] //
    5. // Use it freely, just let me know, //
    6. // PLEEEEZE!!! //
    7. ///////////////////////////////////////
    8. //'|#&{}[]<>*;
    9. var nx, ny, dis, dis2, dir, col, scale, rep, check, inst, dens;
    10. //just setting up variables:
    11. nx = 0 ny = 0 dis = 800 dis2 = 8
    12. dir = point_direction(x,y,mouse_x,mouse_y)
    13. dens = 8
    14. rep = (dis/dens)
    15. scale = 1
    16. check = 1
    17. inst = 0
    18. col = (make_color_hsv(160,240,200))
    19. image_blend = c_blue
    20. //repeat - to draw the particles at points between shooter and target
    21. //target is at the distance of the dis variable value.
    22. repeat (rep)
    23. //check - if there is no obstacle at nx ny coordinates
    24. {if check = 1{
    25. //scale sprite, make flaming beam effect
    26. scale = random(1);
    27. //next coordinates of drawing the new particle of beam
    28. nx = (x + dis2 * cos(degtorad(dir)));
    29. ny = (y - dis2 * sin(degtorad(dir)));
    30. //blend it!!!!
    31. draw_set_blend_mode(bm_zero)
    32. //draw the sprite - experiment with it!
    33. //if action_if_dice(2)
    34. draw_sprite_ext(sprball,-1,nx,ny,0.9 + scale,0.3+random(scale/2),dir,((image_blend)+col),0.4) /*else
    35. draw_sprite_ext(sprball,-1,nx,ny,0.5+random(scale/2),0.9 + scale,dir,((image_blend)+col),0.4)*/
    36. //if there is obstacle, stop drawing of beam in this step.
    37. //and store the id of obstacle in the inst variable.
    38. if place_free(nx,ny) = false then {check = 0 inst = instance_nearest(nx,ny,all)
    39. //now we must draw the ending effect of beam
    40. //add distance, where the ending effect will be
    41. dis2 += 16
    42. //add this new distance to coordinates
    43. nx = (x + dis2 * cos(degtorad(dir)));
    44. ny = (y - dis2 * sin(degtorad(dir)));
    45. //and draw it!
    46. repeat (5)
    47. draw_sprite_ext(sprball,-1,nx,ny,0.1+random(scale),1 + scale*(1+random(1.5)),random(360),((image_blend)+col),0.7)
    48. }
    49. //else increment 8 pixels to dis2, for drawing next particle of beam there.
    50. else dis2+=dens
    51. //But if there is some obstacle and its object index is victim,
    52. if (check = 0 && (inst).object_index = victim) then
    53. //then take off its health.
    54. inst.hp -=1
    55. }
    56. }
    57. //stop blending
    58. draw_set_blend_mode(bm_normal)
    Alles anzeigen

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von Floz ()

  • wie schnell is der schuss? also in gm-speed...
    █████ ██ █ ████ everything ███ █████ is █████ ████ ████ fine ████ ███ █ ██████ love.
    █████ ███████ ███ your █████ ████ government.
  • das problem ist warscheinlich:
    die geschwindigkeit ist zu gross und das bild zu klein(es wird einfach übersprungen)
    mach das bild grösser oder ändere das script ein bischen
    Dragoon
    int (*x(*x(int))[5])(int*);
    Confused? Yes, it's C!
  • genau das wollt ich damit sagen, danke Dragoon :D
    █████ ██ █ ████ everything ███ █████ is █████ ████ ████ fine ████ ███ █ ██████ love.
    █████ ███████ ███ your █████ ████ government.
  • Benutzer online 1

    1 Besucher