shuffleboard

Get help using Construct 2

Post » Wed Jul 10, 2013 11:54 am

I am trying to create a shuffleboard type game for both pc and mobile, I browsed the forum & tutorials, but seeing how I am a newbie I don't know exactly where to start to implement a swipe event/action.

I would like to use mouse with click and of course touch and swipe on mobile but most examples already assume you have some knowledge of the two.

Could anyone point me in the right direction?

Thank you for any help.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Wed Jul 10, 2013 12:36 pm

Hi @jeffige,

The touch object is also set up to accept mouse inputs (so that should solve one problem).

The touch object allows you to compare touch speed (go to add event, select the touch object and you should see the option). Also you can save the x,y co-ordinates on start of touch and compare these to the x,y co-ordinates on end of touch. So really you could use either of these to indicate whether the player is swiping or not.

Hope that helps to get you started :)
B
33
S
6
G
7
Posts: 494
Reputation: 8,252

Post » Thu Jul 11, 2013 1:54 pm

Thanks Blacksmith for the reply.

Since I don't know how to test it on my android phone yet, I am stuck with my pc. J got the puck to move with move toward mouse.x & mouse.y but it the puck moves off the layout. I have solid, bound by layout and physics behaviors for the puck.

1st, should i start with a general template or with a mobile template since i would like it played on both?
2nd, i need to add move at angle on start of touch & end of touch, correct?

I have all the sprites which is only 4 cause i would like to add multi player option, but i wouldn't think something so easy as just sending a puck off could be so daunting. I have worked through multiple tut's and even read through the manual. But if you don't know what questions to ask, you can't ask them, like should i use bullet,physics or none, and should i use move at angle, toward position, or speed.

Again, thanks Blacksmith for helping out a newbie.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Jul 11, 2013 2:17 pm

To make it even more complicated for you, you could probably use all of your suggestions.

The big question is:"What are you trying to achieve?"

First of all if you want to be able to use it on touchscreen you better start with touch right away. Touch and mouse work differently, so if you have the mouse-part working it could go bust on touch-screen.

on touch start add a variable for x and one for y and compare them to on touch end x and y. you can then get the angle(touchstart.x,touchstart.y,touchend.x,touchend.y) and send your puck in that direction with for instance the bullet behaviour...
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 11, 2013 2:30 pm

Thanks for that LittleStain,

The end result will be a puck centered at screen bottom. Player swipes a finger or left mouse click and push up on pc, to send the puck upwards to scoding area, which there are 3, just like on a table shuffleboard.

The swipe/ mouse click should be a very small area as in shuffleboard. When player sends off another puck it should be able to bounce off other pucks. I was thinking i would need to use physics, but i haven't even got to the point of sending the puck off correctly yet.

Thanks again for any help.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Jul 11, 2013 4:02 pm

Here's a very simple example

CapX
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 11, 2013 6:18 pm

Thanks LittleStain,


Trying to recreate your events to work for mine, but 1st thing i see is the box shoots off the layout. I added wall boh daries in mine to see if that would help. Also, how could i get the box to slow down as in real worl? Would i use physics then adjust friction?

Thank you, again.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Jul 11, 2013 6:44 pm

I wouldn't use physics for a game like this, but you can if you want to..
instead of giving the bullet a speed you would give the object an impulse in the direction.

I've upgraded the example.. The bullet now bounces of solids and acceleration is set at a high number..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 8 guests