Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (henrybane), 1,182 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
laser targeting #136365
06/13/07 22:37
06/13/07 22:37
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
tompo Offline OP
User
tompo  Offline OP
User

Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
A little contribution how to make a laser (light) targeting not using a model but bmap, which looks better I think and it's more easy to do
You can add a alpha schannel or etc

If you want to see it in action look at my "space war" project in "showcase I" section LINK
all of the others ships are using this code but only player doesn't... yet
And of'course You may change vecotr to vec_for_vertex for better looking

Code:
 
var my_target[3];
function laser_targeting
{
my.passable = on; my.oriented = on; my.facing = off;
my.flare = on; my.bright = on;
while(you)
{
proc_late();
c_setminmax(me);
vec_set(my.x, you.x);
vec_lerp(my.x,you.x,my_target.x,0.5);
vec_set(temp, you.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan,temp);
my.tilt += 90;
my.scale_y = vec_dist(you.x,my_target.x) / 5; //5 is the height of the bmap
wait(1);
}
}

action gun_action
{
ent_create("your.tga",my.x,laser_targeting); //small one like 5x5
while(me)
{
vec_set(my_target, nullvector);
my_target.x = 500; //lighting range
vec_rotate(my_target, my.pan);
vec_add(my_target, my.x);
wait(1);
}
}



Last edited by tompo; 06/14/07 09:35.
Re: laser targeting [Re: tompo] #136366
06/14/07 04:24
06/14/07 04:24
Joined: May 2005
Posts: 819
U.S.
Why_Do_I_Die Offline
Warned
Why_Do_I_Die  Offline
Warned

Joined: May 2005
Posts: 819
U.S.
Looks like a very good contribution , might come in handy for my current project.


Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1