Tag Archives: Capx

Point Towards Position On 2 Different Layers

Made for a user on the forums this example shows how to make an arrow point towards another object.  While this may seem pretty trivial the two objects are on 2 different layers with 2 different parallax settings.

The example makes use of the System Expressions LayerToCanvasX and LayerToCanvasY.

DOWNLOAD

Array: Copy Values From One Array To Another – No Repeat

Created for a user on the forums but never actually posted because I was ninja’d.

This example has an array of names, each time space bar is pressed, a random name is chosen and moved to a new array.  That name is then removed from the original array so the names are never repeated.

DOWNLOAD

8 Direction Movement With Gamepad – Twin Stick Version

While working on a personal project I was thinking about the control scheme.  It was going to be an 8 Directional shooter with Twin Stick controls.  I came up with 2 versions so I though I’d share them here.

The example has 2 groups that hold the events.  Simply activate one and deactivate the other to try each version.

Type 1 – You move with left stick but always face the direction the right stick is/was held in.

Type 2This is my preferred version.  You can move with left stick and you always face the direction of movement until you use the right stick when you’ll face in the right stick direction but move in any direction.

DOWNLOAD

Detect Sword Hits With Image Points

Another older example that I never posted here.  Created for a user on the forums it shows how you can use image points rather than detector sprites for detecting sword hits on an enemy.  This is useful if you use sword swing animations rather than a sword object in your game.  It can of course be used in other situations.

DOWNLOAD