Inherits from CCActionInterval
Conforms to NSCopying
Declared in CC3Actions.h

Overview

CC3ActionMoveDirectionallyBy is an abstract subclass of CCActionInterval that is the parent of subclasses that move a target CC3Node by a specific translation distance in a direction relative to the orientation of the node.

The direction of movement is evaluated on each update frame. If the node is also being rotated over time, this action will follow the change in orientation of the node, and adjust the direction of movement.

This is an abstract class. Subclasses define the actual direction of movement by overriding the targetDirection property.

Properties

targetDirection

The direction of movement.

@property (nonatomic, readonly) CC3Vector targetDirection

Discussion

This property is accessed on each update frame to determine the current direction of movement. If the node is also being rotated while this action is active, this direction will be different for each frame.

The abstract implementation simply returns kCC3VectorZero. Subclasses will override this property to return the current direction of movement.

Declared In

CC3Actions.h

Class Methods

actionWithDuration:moveBy:

Allocates and initializes an autoreleased instance to move the target node by the specified distance in the direction, as indicated by the subclass, within the specified time duration.

+ (id)actionWithDuration:(CCTime)t moveBy:(GLfloat)aDistance

Discussion

The specified distance may be positive or negative, indicating whether the node should move forward or backward, relative to the direction of movement.

The direction of movement is evaluated on each update frame. If the node is also being rotated over time, this action will follow the change in direction of movement of the node.

Declared In

CC3Actions.h

Instance Methods

initWithDuration:moveBy:

Initializes this instance to move the target node by the specified distance in the direction, as indicated by the subclass, within the specified time duration.

- (id)initWithDuration:(CCTime)t moveBy:(GLfloat)aDistance

Discussion

The specified distance may be positive or negative, indicating whether the node should move forward or backward, relative to the direction of movement.

The direction of movement is evaluated on each update frame. If the node is also being rotated over time, this action will follow the change in direction of movement of the node.

Declared In

CC3Actions.h