That said though, if your cutting-edge method gets the kinks out of it and you can get a system using such working I wouldn't mind taking a look at its source.

Code: Select all
//used in ship's firing event, the variable 'beamfiring'
//must be 0 to call this script
bol=instance_create(argument1,argument2,beamshot_obj)
bol.dir=argument3
bol.master=array_mstr
if argument4=0 {bol.depth=depth+1} else {bol.depth=argument4}
bol.image_speed=.5
bol.maxscale=argument5
bol.minscale=argument5/2
bol.damage=argument6
bol.length=sprite_get_width(beam1_img)
Code: Select all
// CHECK FOR TARGET*********
if nearen!=0
{
rep=round(abs(master.y-(nearen.y))/length)
//reset target
if instance_exists(nearen)
and nearen.no_hit=0 //collision modifier
and nearen.enemy_health>0
{}
else {nearen=0}
}
if nearen=0 {rep=round(master.y/length)+1}
rep2=round(master.y/length)
if rep<=0 {rep=2}
// CREATE BULLET*********
if start=0
{
//mastr_shot is the default enemy bullet object
bol2=instance_create(x,y,mastr_shot)
bol2.sprite_index=beam1_img
bol2.image_yscale=maxscale
bol2.image_xscale=rep2
bol2.image_alpha=0
bol2.damage=damage
bol2.master=id
bol2.extra_type=1
start=1
master.beamfiring=1
//player can only create beam obj
//while this variable is zero
}
// DRAW BEAM*********
if fadeok=0
{
// scaling effect -expands from 0 at start, then 'wobbles'
if phase=0 {if scale<maxscale {scale+=.05} else {phase=1}}
if phase=1 {if scale>minscale {scale-=.05} else {phase=0}}
repeat(rep)
{
//beam1_img = start/firing image
//beam2_img = main image
//beam3_img = 'hit' image
xx+=1
xmod=master.x+lengthdir_x(length*xx,dir)
ymod=master.y+lengthdir_y(length*xx,dir)
if xx=1{img=beam1_img} else
{
if xx<rep {img=beam2_img}
else {img=beam3_img}
}
draw_sprite_ext(img,-1,xmod,ymod,1,scale,dir,c_white,1)
}
xx=0
// BULLET OBJ MATCHES DIMENSIONS,POSITION OF BEAM (for collisions)*********
if instance_exists(bol2)
{
//since it will be scaled from the center,
// bullet is placed directly
//in the middle of the length of beam
bol2.image_angle=dir
bol2.x=master.x+lengthdir_x((length*rep)/2,dir)
bol2.y=master.y+lengthdir_y((length*rep)/2,dir)
bol2.image_xscale=rep
}
//replace bullet
shottimer+=1
if shottimer=4
{
if instance_exists(bol2) {with bol2 {instance_destroy()}}
start=0
shottimer=0
//nearen=0
}
}
//TERMINATE BEAM******
if instance_exists(mastr_ship)
and (keyboard_check(global.fire_button)
{} else {fadeok=1}
if fadeok=1
{
// beam's scale shrinks back to zero, then
//destroys itself and any remaining bullets.
if scale>0 {scale-=.05} else
{
if instance_exists(bol2) {with bol2 {instance_destroy()}}
instance_destroy()
master.beamfiring=0
}
}
Code: Select all
if extra_type=1 { master.nearen=other.id}
You deserve it!Granted, I might just take a long, long break now...
Platformer mechanics, I believe.mice wrote:T-shirts ftw!
...but I don't foresee conquering the issues I had anytime soon...
What were these issues?