Missile that leaves behind a crisp line where it flew Forum Home > Construct Classic > Construct Classic Discussion > Help & Support using Construct Classic |
Post Reply
|
Page 12> |
| Author | |
Post Options
Quote Reply
Topic: Missile that leaves behind a crisp line where it flewPosted: 08 Dec 2009 at 11:00am |
|
|
Okay, I've hit a road block... let me tell you what I'm trying to get. I have a missile object that flies towards enemies. It flies very fast (I've limited the bullet setting for speed for 2000, so yeah, that's the max speed). I want a bright trail to stay temporarily in the path that the missile flew. You know that kind of effect right?
I tried having an event Always set a particle object to the missile's (X,Y). I set up the particles object to just create a particle at no speed, no movement or anything, with no variation. More or less it was set just to spit out a uniform block at its emitting spot... which would theoretically make a line by the end. So I tried that but the missile was going so fast that the particles wouldn't emit fast enough to make a consistent line, even when I pumped up the particle rate to insane levels. There were a few skips and gaps in the line. It was --ALMOST-- what I was looking for, but the line drawn didn't have that solid, clean look that I was looking for. There were a few spaces and gaps in the line and the particle object in general seemed, well, more like particles than an actual curvy line (how about that, uk yuk!). It's not exactly the effect I'm looking for. I'm willing to use particles if I can't figure out a different method... but ... *whines* Is this possible to get this effect? Again, I'm looking for something that essentially that would draw a thin trail behind the missile that would disappear after a second or two, and I've tried a couple different things but couldn't get it to work right. Something tells me that a particle object is the way to go, but I can't seem to get it to emit properly if it is. Help me, oh gurus of Construct. |
|
![]() |
|
Post Options
Quote Reply
Posted: 08 Dec 2009 at 11:46am |
|
|
The particles object is probably actually not what you want - you want a customised system for drawing a line.
I think the best thing to do would be to manually spawn a sprite every tick, and resize and angle it so that it touches the start of the previous particle. Then, you should get a series of joining up lines which you can fade out with the fade behavior etc. |
|
![]() |
|
Post Options
Quote Reply
Posted: 08 Dec 2009 at 2:12pm |
|
|
adding to ash's suggestion
you need to store the missiles x,y position before it had moved using variables (just set one to missile.x, the other to missile .y, in an always event at the very bottom of the sheet) and create an sprite with a plain texture (just a colour fill) at that point, set the height to the desired "thickness" of your trail, and set the width to distance(trail.x,trail.y,missile.x,missile.y). then set the trails angle towards the point on the missile where the trails are spawned on (by default its the hotspot, but im assuming you want it on the back), do these events always add to the always an event that sets the trails opacity to ".opacity-(speed of fadeout perframe)" and maybe some timedelta stuff but that shouldnt be hard to figure out if youre using timedelta already. lastly create an event to check if the opacity of the trail is less or equal to 0, and add an action that destroys it in that event. thats all ! ^_^ |
|
![]() |
|
Post Options
Quote Reply
Posted: 08 Dec 2009 at 6:47pm |
|
|
Are you looking for something like this?
viewtopic.php?f=16&t=5172 You can change the thickness and fade rate by messing with the numbers a little. Or use a different trail sprite to get a different effect entirely. |
|
![]() |
|
Post Options
Quote Reply
Posted: 08 Dec 2009 at 10:07pm |
|
|
Thanks so much guys. This thread was very very useful. I got the effect I wanted by using some of the techniques you guys mentioned. At first I thought I could just up and copy most of the events from DeadEye's cap. My laziness didn't pay off so well, it didn't work so smoothly, but it served as an excellent outline for how the basic set up should be. After about an hour or so of tweaking, everything is running perfectly!
Now i can have multiple heat seeking missiles chaotically flying towards different enemies on screen, all with crazy light trails everywhere and it actually looks exactly how I wanted it to! thanks guys. |
|
![]() |
|
Post Options
Quote Reply
Posted: 10 Dec 2011 at 1:26pm |
|
|
After about an hour or so of tweaking, everything is running perfectly!
Now i can have multiple heat seeking missiles chaotically flying towards different enemies on screen, all with crazy light trails everywhere and it actually looks exactly how I wanted it to! <!-- s:D --> thanks guys.[/QUOTE] would you mind uploading the cap so i can have a quick look at how you done it as im a little stumped atm, and im wanting to do bassicly the same thing but with a trail of paint after my paintbrush sprite. |
|
![]() |
|
Post Options
Quote Reply
Posted: 10 Dec 2011 at 2:28pm |
|
|
@bizla you ask on a thread that is more than two years old. Also, the one you adress to was last active 1 year and 5 months ago, according to his profile.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 10 Dec 2011 at 2:55pm |
|
|
ah good point :L i didnt notice the dates
|
|
![]() |
|
Post Options
Quote Reply
Posted: 06 Jan 2012 at 12:36am |
|
|
Strike did you say you made an object seeking missle? I am looking to make bullets project towards an object that is moving at different locations.
|
|
![]() |
|
Post Options
Quote Reply
Posted: 06 Jan 2012 at 12:31pm |
|
|
Just what Tulamide said...
Strike911 Last Active 1 year and 6 months ago I think he won't reply in the next time. Edited by zyblade - 06 Jan 2012 at 12:31pm |
|
![]() |
|
Post Reply
|
Page 12> |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |