How do I Stop the player from leaving the screen

Just started using Construct 2? Post your questions here

Post » Mon Dec 12, 2016 10:38 am

It's just the basic, you need to improve it with more AI. =]
Image
B
108
S
24
G
18
Posts: 1,373
Reputation: 22,824

Post » Tue Dec 13, 2016 7:40 am

Hi again Telles0808

I am running on the free version of Contruct 2 at this time and the latest version I can obtain is 239, however the project file you have kindly added to this thread is for version 240 so I cannot open it :( . I presume there is no way of saving this to an older version of Construct 2 ?

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Tue Dec 13, 2016 11:31 am

You still be able to open it.

I'll ask you to do some steps:
  • Change the file extension from ".capx" to ".zip";
  • Extract it;
  • Open the ".caproj" file with notepad;
  • Find the line with <saved-with-version>24000</saved-with-version> and change the "24000" to "23900";
  • open the .caproj using C2;
That's it. =]
Image
B
108
S
24
G
18
Posts: 1,373
Reputation: 22,824

Post » Wed Dec 21, 2016 8:49 am

Hi again TELLES0808

Not sure if it is to do with my version of Construct 2 but when I run the example, the object do eventually leave the screen. Is this an issue with my version of Construct 2 ?

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Wed Dec 21, 2016 10:44 pm

6 Parts. The super simple way (you misunderstood 'layout' in BoundToLayout).

https://www.dropbox.com/s/qp8ylpczixfrt ... .capx?dl=0
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Dec 22, 2016 8:25 am

99Instances2Go wrote:6 Parts. The super simple way (you misunderstood 'layout' in BoundToLayout).

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



Thanks once again 99Instances2Go I will look at this :)
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Dec 22, 2016 10:54 am

timcs, this is ofcourse made for basic needs, and it answers your first question.
If you need the parts to have displaced origins, then we got to go a step further.
If the parts need to be able to (by instance) rotate or scale, when we got to take it 5 steps further.

Need to know your needs.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Dec 22, 2016 1:21 pm

99Instances2Go wrote:timcs, this is ofcourse made for basic needs, and it answers your first question.
If you need the parts to have displaced origins, then we got to go a step further.
If the parts need to be able to (by instance) rotate or scale, when we got to take it 5 steps further.

Need to know your needs.



Hi 99Instances2Go

the objects are all pined together at the start of the game, I then , when each part was used to be dragged, switched the pin method around. From your capx (and I cannot see how you have done this) you have managed to have all of the parts "stuck" together within the playerbox and it appears that the dragging is driven from the player box only.

This would simplify my process some what but I cannot see how you have managed to get the player parts to stay together when I click inside the box.

Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Dec 22, 2016 4:56 pm

The player parts are instances of the same object 'player', so, without picking, 1 action moves them all. They just have another animationframe (can be done with animations too)
Catch: they all have the same origin.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Dec 23, 2016 5:19 am

99Instances2Go wrote:The player parts are instances of the same object 'player', so, without picking, 1 action moves them all. They just have another animationframe (can be done with animations too)
Catch: they all have the same origin.



OK, could this way of working affect the collision of the objects because the reason why I used the "pin" method was that I only wanted one part of the player object to actually collide and interact with the enemy and the other parts to just be used for dragging/moving the player about


Thanks

TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

PreviousNext

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests