Hockey Type Game

  • 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.

  • You can either invert a normal touch event or use variables :)

  • Touch object doesn't allow me to invert it.

    <img src="https://dl.dropbox.com/u/10196246/touch%20invert.jpg" border="0" />

  • Could you give an example of doing it with variables?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

  • 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.

    scirra.com/manual/119/touch

  • 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

  • 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.

    <img src="https://dl.dropbox.com/u/10196246/touchmove.JPG" border="0">

    Hockey

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)