Hockey Type Game

Get help using Construct 2

Post » Wed Dec 26, 2012 3:29 pm

I'm trying to create a game where two players can drag hockey type pucks around from above. I have that bit working ok.

But I can't seem to get the puck to orient in the direction of travel and shoot off at speed when released by the finger. Is there a way to say "when object not in touch".

Any help appreciated.
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed Dec 26, 2012 3:47 pm

You can either invert a normal touch event or use variables :)
B
50
S
14
G
3
Posts: 540
Reputation: 5,636

Post » Wed Dec 26, 2012 4:12 pm

Touch object doesn't allow me to invert it.

B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed Dec 26, 2012 4:32 pm

Could you give an example of doing it with variables?
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed Dec 26, 2012 4:52 pm

You can invert a "Is touching object" event, you may want to try that way :)

For variables you could a bool where the condition for true is the object being touched, and then move your event sheet from there, it's effectively the manual way of doing inversion.
B
50
S
14
G
3
Posts: 540
Reputation: 5,636

Post » Wed Dec 26, 2012 5:03 pm

I totally missed the is touching object event. That has got me over one hurdle at least. On to the next one! Thanks Mystery Bear!
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Wed Dec 26, 2012 7:44 pm

There are new expressions in the touch event that you also might find useful.

AngleAt(index)
AngleForID(id)
Get the angle of motion of a specific touch in degrees by its zero-based index or unique ID. A touch must be moving across the device screen for this expression to contain a useful value.

SpeedAt(index)
SpeedForID(id)
Get the speed of a specific touch by its zero-based index or unique ID. Touch speed is measured in canvas pixels per second, so is not affected by scaling the display.

AngleAt(index)
AngleForID(id)
Get the angle of motion of a specific touch in degrees by its zero-based index or unique ID. A touch must be moving across the device screen for this expression to contain a useful value.

https://www.scirra.com/manual/119/touch
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Wed Dec 26, 2012 9:54 pm

Cheers. I tried those but I can't get it working as well as bullet angle of motion for some reason. Even that isn't working great. Maybe someone could take a look at this cut down project?

Hockey
B
19
S
3
G
2
Posts: 212
Reputation: 4,011

Post » Thu Dec 27, 2012 3:15 pm

I experimented with touch.angleat(0) and it does work....but only when you drag the puck fast in the middle of the screen. Don't know what to do when it only works sporadically.



Hockeykenhes2012-12-27 15:38:07
B
19
S
3
G
2
Posts: 212
Reputation: 4,011


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, jfcservices, selaus and 0 guests