Infinite Speed and Line Drawing.

For questions about using Classic.

Post » Sat Apr 10, 2010 1:22 am

Because of the limitations of not using motion blur, I have decided to make my bullets instant hit. This however leaves me without the ability to use tracers/bullet trails. I was wondering how I would draw a line from the barrel of the gun to where the bullet would go, but only maybe about 600 pixels long. If I set a sprite, or line, to the angle of the round, or where the round is, it just goes straight. I would assume this is because the bullet is gone as soon as it isnt.

If anyone has any input I would be very appreciative.
B
2
G
3
Posts: 46
Reputation: 942

Post » Sat Apr 10, 2010 4:21 pm

The usual way is to have a sprite which you set the width to distance(gun.x, gun.y, target.x, target.y) and the angle to angle(gun.x, gun.y, target.x, target.y), which effectively draws a line between the two. (Note this does not reference the angle of the bullet at all)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sat Apr 10, 2010 6:08 pm

Thanks for that, but is there any way to set the length of the line... differently? I... will just test on my own. Thanks alot.
B
2
G
3
Posts: 46
Reputation: 942

Post » Thu Feb 03, 2011 3:49 am

Well, I am casting revive on this thread! I need some help with this exact thing once again. I can't seem to figure out exactly where the bullet is. I can't seem to make any sort of tracing line. Can anyone help me? I know I got this to work last time, I just can't this time. I find it really odd.
B
2
G
3
Posts: 46
Reputation: 942

Post » Thu Feb 03, 2011 6:39 am

i remember when i asked Tulamide how can i program a "laser" weapon so the laser sprite will have an end and a start but the leight of the middle will get repeated as much as it takes to strech the psrite from one point to another (was it closer or further away). He adviced me to use the Panel Object. Your "bullet trace" is technicaly another version of that "laser" i used. I am not 100% sure will this help but still you might want to check it out.
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Fri Feb 04, 2011 1:17 am

I am not certain if that will really fix the problem I am having. The problem I am having is that since the bullet is instant hit there are no x and y values to turn the line to. At least that is what it seems to be.
B
2
G
3
Posts: 46
Reputation: 942

Post » Fri Feb 04, 2011 3:20 am

The examples given assume you have a target, but if this is side view, that would mean your just shooting in a general direction.
Perhaps you should try another method for getting the trail besides an fx.
[url:2sgugz95]http://dl.dropbox.com/u/666516/bulletrail.cap[/url:2sgugz95]
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests