Object centering in touch game

Just started using Construct 2? Post your questions here

Post » Thu Mar 06, 2014 2:25 am

I recently made a touch based brick breaker game. Unfortunately when i start the game the paddle start all the way at the left side of the screen. The game is still playable but it looks ridiculous and appearance can make or break a game. also for some reason my win/loss events aren't working. As the .capx is to large to attach I have posted a dropbox link to it.
dropbox.com/s/osz60dko5ic6frs/Indy_16export2real.capx
B
6
S
1
Posts: 47
Reputation: 759

Post » Thu Mar 06, 2014 8:51 am

August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
33
G
47
Posts: 1,194
Reputation: 30,812


Post » Sat Mar 08, 2014 2:11 pm

I added a global variable called "touchHere".
On start of layout I set touchHere to half the window width.
When timescale is not 0 I set the paddle's X to touchHere.
When in touch I update touchHere with Touch.X

This seemed to work. Image attached for clarity.
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
3
Posts: 172
Reputation: 1,933

Post » Fri Mar 14, 2014 5:51 pm

thanks very much
B
6
S
1
Posts: 47
Reputation: 759


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest