How do I Follow this sprite in all of motion angels speed .

Get help using Construct 2

Post » Thu Aug 03, 2017 7:51 am

Hi everyone
I have two sprite I want when one of them collision with other ... Follow this sprite in all of motion angels speed ... the contiur & pin behavior didn't do what I want .... how can I do that.
Thanks .
B
8
S
1
Posts: 13
Reputation: 426

Post » Thu Aug 03, 2017 11:02 am

ismailsawan wrote:Hi everyone
I have two sprite I want when one of them collision with other ... Follow this sprite in all of motion angels speed ... the contiur & pin behavior didn't do what I want .... how can I do that.
Thanks .



Sprite1>> On collision with >> Sprite2 :

Action: Sprite1 >> set angle to Angle(sprite1.x, sprite1.y, sprite2.x, sprite2.y)

Capx: https://www.dropbox.com/s/8nvme756ejhwm1p/Follow.capx?dl=0
B
38
S
22
G
63
Posts: 233
Reputation: 35,554

Post » Fri Aug 04, 2017 8:03 am

Tarek2 great thanks to you
I do that but I want do something else I want to follow in movement for the first sprite
I.x ( the first sprite have movement rotation and I want the second sprite to follow this movement ).
B
8
S
1
Posts: 13
Reputation: 426

Post » Fri Aug 04, 2017 3:52 pm

ismailsawan wrote:Tarek2 great thanks to you
I do that but I want do something else I want to follow in movement for the first sprite
I.x ( the first sprite have movement rotation and I want the second sprite to follow this movement ).



Im not really sure I understand you properly, it sounds like you want to imitate the other sprite movements, if so 99InstancesGo had a really nice example in this post
viewtopic.php?f=147&t=194282&p=1133815#p1133815

If is not the one that you are looking for can you explain more what are you trying to accomplish or a capx will be more helpful
B
38
S
22
G
63
Posts: 233
Reputation: 35,554

Post » Fri Aug 04, 2017 4:27 pm

Hi man
B
3
Posts: 1
Reputation: 187

Post » Fri Aug 04, 2017 4:45 pm

Mihai769 wrote:Hi man


@Mihai769

This post and the one you posted in the Education section (deleted) are of no relevance to the threads.

If you persist in pointless posting you will be banned.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
134
S
30
G
84
Posts: 5,380
Reputation: 58,442

Post » Sat Aug 05, 2017 1:03 pm

Tarek2 great thanks
I do it the problem with me that I was make event do every tick and that make the bug I changed to do in start of layout and it fix I made it with pin behavior and it,s going good
Great thanks for your help

I want to now what's the different between every tick and on start of layout ....

And I have one more question I make sprite swap object have bullet behavior .... I want this object to stop on mouse crosshere not to going out the screen

Sorry for my a lot of questions but I'm very beginner on game develop and thanks again for your help 😀👍
B
8
S
1
Posts: 13
Reputation: 426

Post » Sat Aug 05, 2017 3:03 pm

@ismailsawan

Jejeje great that you fixed it because I have to admit that I'm completely lost with this post, my head is going like Meeeeh!! in the good way of course :D :D



On start of layout: Is a trigger that is (Triggered or Fires) when the layout begins. Meaning that it Only happens once and it happens always at the start of the game.
What are Triggers??
This indicates that the event is triggered. Rather than running once per tick, this event simply runs (or "fires") upon something actually happening. In this case, the event runs when the layout starts. It is never checked any other time. Since triggers run upon an event happening, they aren't checked in top-to-bottom order like other events. This means the ordering of triggers relative to other events is not important (except relative to other triggers of the same type, since triggers still fire top-to-bottom).
Normally you recognize the triggers by the green arrow and the most of them if not all start by (On)
Example: On collision, On Jump, On Created, On Destroyed etc....... those are all triggers that run once every time the condition is met.


Every Thick: is A condition which is always true Any Action you add here it will be updated 1 per thick which is = 60 times a second in most of the Pc, Meaning that is for actions that you need to update continuously none stop,

You can test it out by yourself really quick all of this, you see this capx we wanna make the car1 follow the car2 continuously and we make this by setting the angle from car1 to car2, but once you run it the first time you will notice that it will not follow the car2 because the set angle action only triggers once and it will happen only once this will only work if the car2 will be not moving, but the car2 its constantly moving so the set angle it will have to keep updating every thick to keep track of the car2 angle, so this will only work if you use the (Every thick)
So now move the Action from the (Start Of Layout) to the (Every Thick) and you will see that now is working great because the angles are keeping updating every thick, I hope it makes sense for you if not you can ask.

https://www.dropbox.com/s/xzngq55uaiyqvf3/Follow2.capx?dl=0

You should check the tutorials (system-conditions) and (How Events Work) to have a better view.
B
38
S
22
G
63
Posts: 233
Reputation: 35,554

Post » Sat Aug 05, 2017 3:21 pm

@ismailsawan
[And I have one more question I make sprite swap object have bullet behavior .... I want this object to stop on mouse crosshere not to going out the screen]

I'm not sure if I understand

I suppose that on (mouse crosshere) means that on mouse click object >> Stop object

Mouse: >> On (Right or Left) clicked "object"

ACTION: "object " set bullet Enable:>> to Disable


you can always make a quick drawing picture explaining what you trying to do maybe will be easier for you, with steps 1, 2 etc....
B
38
S
22
G
63
Posts: 233
Reputation: 35,554

Post » Tue Aug 15, 2017 8:32 pm

tarek2 great thanks to you :D :D
B
8
S
1
Posts: 13
Reputation: 426

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests