How to make bullet follow the line just drew

Get help using Construct 2

Post » Wed Sep 19, 2012 2:39 pm

Also line segments seem to get drawn ahead of the mouse point so it seems like the condition of the distance being greater than 20 doesn't work properly. I would really appreciate anyone helping me get this to work properly
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Wed Sep 19, 2012 5:21 pm

@theames Recent changes to how objects are spawned have broken it but Ashley has suggested that he'll reverse those changes so it may work again in r104. Here's an updated version anyway that works around the spawning issue.
rocketFollowPath_fixed.capx (r103.2)ramones2012-09-19 17:22:10
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Wed Sep 19, 2012 8:09 pm

Thanks for getting back to me this has drive me mad all day so it's good to know cheers

I started using way points plotting them down by keeping checks on the distance the mouse had moved but it was very inconsistent. Got no idea why. But this one you have sen me seems to do the job so cool and thanks again
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Wed Sep 19, 2012 8:46 pm

@Ramones, where had Ashley said he'd reverse those changes? I thought it was clear that he wasn't going to.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Sep 19, 2012 9:03 pm

B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Thu Sep 20, 2012 2:21 am

@ramones fantastic! Nailed it.
B
20
S
10
G
4
Posts: 106
Reputation: 4,219

Post » Thu Sep 20, 2012 9:47 am

@Ramones you are a GENIUS!!!

I have one more favour to as of you and I will leave you in peace I promise!

I'm really struggling with this which is why I am asking, but I would like to amend your capx so that I have multiple instances of the rocket already on the layout, and I would like them to have a speed set from the start, so they are all moving slowly in a direction when the game starts. I then want to be able to click on a rocket and then draw the path for that rocket

Problems i have are setting an initial speed causes the rocket to just jump down the page vertically while i am drawing the line

another problem is when i mouse up after drawing the line, i am then able to drag and drop more lines which get joined on to that one.

I set this up by simply setting an initial speed on the rocket and changing the line where you spawn an instance of the rocket, i changed it to detect the mouse click over an instance of the rocket

Any help super appreciated and I will definately be adding you to the credits with massive praise when this is done
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Thu Sep 20, 2012 10:14 am

I thought it might help if I gave you a capx of what I've done:

http://dl.dropbox.com/u/73268676/controller.capx

youll see i have changed the rocket to 2 monsters for now, and made them bigger so i can click them easier for the test, slowed it down too


if you click on a monster instance and draw a path the monster starts flying off all over the place, i tried setting the dist_to_next back to 0 on the mouse click which helps but still similar results


basically what im after is you should be able to click on a monster and draw its path, it will follow it BUT if you click on it again while its on that path and draw a new path, the original path should be dtestroyed and it should move to the new path

I played about with looping the dashes where the rocket variable was the instance you cclicked on and destroying them but then it doesnt move at all, maybe i was destroying the first one straight after it was created, i dunno, I'm really stuck
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Thu Sep 20, 2012 2:20 pm

I got it all working now thanks for the info
B
11
S
2
G
3
Posts: 95
Reputation: 3,028

Post » Fri Jul 11, 2014 5:28 pm

THANKS! I am trying something similar
B
13
S
5
G
1
Posts: 119
Reputation: 2,292

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests