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.
Alles anzeigen
Manchmal, geht der Schuss, der da gedrawt wird durch die gegner durch, aber nur manchmal.
GML-Quellcode
- /////////////////////////////////////////////
- // This script is created by Jan Kaleta //
- // [EMAIL]ganjashaman@seznam.cz[/EMAIL] //
- // [URL]www.kaletoviny.wz.cz[/URL] //
- // Use it freely, just let me know, //
- // PLEEEEZE!!! //
- ///////////////////////////////////////
- //'|#&{}[]<>*;
- var nx, ny, dis, dis2, dir, col, scale, rep, check, inst, dens;
- //just setting up variables:
- nx = 0 ny = 0 dis = 800 dis2 = 8
- dir = point_direction(x,y,mouse_x,mouse_y)
- dens = 8
- rep = (dis/dens)
- scale = 1
- check = 1
- inst = 0
- col = (make_color_hsv(160,240,200))
- image_blend = c_blue
- //repeat - to draw the particles at points between shooter and target
- //target is at the distance of the dis variable value.
- repeat (rep)
- //check - if there is no obstacle at nx ny coordinates
- {if check = 1{
- //scale sprite, make flaming beam effect
- scale = random(1);
- //next coordinates of drawing the new particle of beam
- nx = (x + dis2 * cos(degtorad(dir)));
- ny = (y - dis2 * sin(degtorad(dir)));
- //blend it!!!!
- draw_set_blend_mode(bm_zero)
- //draw the sprite - experiment with it!
- //if action_if_dice(2)
- draw_sprite_ext(sprball,-1,nx,ny,0.9 + scale,0.3+random(scale/2),dir,((image_blend)+col),0.4) /*else
- draw_sprite_ext(sprball,-1,nx,ny,0.5+random(scale/2),0.9 + scale,dir,((image_blend)+col),0.4)*/
- //if there is obstacle, stop drawing of beam in this step.
- //and store the id of obstacle in the inst variable.
- if place_free(nx,ny) = false then {check = 0 inst = instance_nearest(nx,ny,all)
- //now we must draw the ending effect of beam
- //add distance, where the ending effect will be
- dis2 += 16
- //add this new distance to coordinates
- nx = (x + dis2 * cos(degtorad(dir)));
- ny = (y - dis2 * sin(degtorad(dir)));
- //and draw it!
- repeat (5)
- draw_sprite_ext(sprball,-1,nx,ny,0.1+random(scale),1 + scale*(1+random(1.5)),random(360),((image_blend)+col),0.7)
- }
- //else increment 8 pixels to dis2, for drawing next particle of beam there.
- else dis2+=dens
- //But if there is some obstacle and its object index is victim,
- if (check = 0 && (inst).object_index = victim) then
- //then take off its health.
- inst.hp -=1
- }
- }
- //stop blending
- draw_set_blend_mode(bm_normal)

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