How do I bound an object to current camera view?

Get help using Construct 2

Post » Fri Aug 12, 2016 1:31 pm

Haha thanks! I've been working on this for quite a while now. In fact you can see versions from development stage under the name 'dodge' (that's what it was called back then).

I've implemented your solution, and I'm glad to say that it works, so thank you! :D

The only thing which could be better is the fact that the player renders before the new co-ordinates for the mouse mapping is set up, so when you try to move the player outside, it looks a bit like the HUD elements when resizing the browser, is this supposed to happen?

Also, the game is set so that any finger (mouse) movements are amplified x2 (I'm going to make this sensitivity adjustable in the future). The offset doesn't have to be there, you can just release the finger (or click button) and move it around and it won't affect the player. You can then touch (click) back wherever it suits :)
Last edited by Eliclax on Fri Aug 12, 2016 1:35 pm, edited 1 time in total.
B
14
S
4
Posts: 17
Reputation: 938

Post » Fri Aug 12, 2016 1:35 pm

I'm not sure I follow what you mean.

I couldn't move the player outside of the viewport, even in the example you provided. It would stop at the edge.

I assumed it was some issue related specifically when using "touch" on a mobile - and that it was working as expected on the browser preview while using mouse.

Can you post a screenshot or gif animation of what you're referring to?

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Aug 12, 2016 1:38 pm

Did you try resizing the window and trying both the horizontal and vertical edges? You can only either exploit the vertical edge or the horizontal one at any one viewport size.

Well basically it jumps out of the viewport for a split second before reappearing back inside.
B
14
S
4
Posts: 17
Reputation: 938

Post » Fri Aug 12, 2016 1:43 pm

Yeah I tired all edges of the screen, and it seemed OK to me. I did change the scaling mode though to letterbox mode before testing it properly - I wanted to make sure I wasn't seeing something that isn't intended, which may have been altering my experience.

Either way, if you use a bounding method then it will never appear outside of that area no matter what method you use to move it (not noticeably anyway).

I'm glad it worked though - it's a pretty neat (and challenging) game so far. I managed a score of 218 haha...

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
84
S
34
G
40
Posts: 3,032
Reputation: 30,499

Post » Fri Aug 12, 2016 1:51 pm

Oh I see...yes letterbox scale would definitely have altered your experience...I mean the player is bounded to layout, so if you can see all sides of the layout at once, then there wouldn't have been a problem. The problem is when you don't want the black lines around the outside of the layout to appear on a phone, so you have to use 'scale inner' for the scaling method. Then one of the viewport edges is not the layout edge anymore, and that's when you have the split second thing. But anyway I'll try to change the ordering of steps and see what I can do :)

And btw, you aren't even getting the full experience... if you tap with two fingers (impossible to do on a computer though) you'll bring up the upgrades panel, so you can then actually use the coins that you've collected so far :) Actually, I'll make it so that pressing the space bar works as well (that's what it used to be)
B
14
S
4
Posts: 17
Reputation: 938

Previous

Return to How do I....?

Who is online

Users browsing this forum: Hassan Hackmi and 8 guests