• entries
24
17
• views
45742

# To Move or not to Move

743 views

[color=#000000][font=Georgia,]
Post by Joel, Programmer at Demergo,[/font][/color]
[color=#000000][font=Georgia,]
A critical element of any game that must be considered carefully when designing and developing is the movement and controls. The decision will affect every aspect of the game and the very feel of play. There are as many movement styles as there are game types. Ranging from the simple run-and-jump of a platformer to the head-scratchingly complicated schemes that allow precise control in flight simulators. In our case we chose a relatively simple setup that works off of lines. When the player drags from fixbot to a point on the screen a line is projected out in front of his finger that collides with walls and objects in that direction. When he releases his finger fixbot is rotated to a correct landing angle and moved through space to the new wall.[/font][/color]
[color=#000000][font=Georgia,]
To handle the movement from the code side we use a modified version of the Cocos 2D engine's built-in movement and rotation actions. By starting from a pre-built engine we avoided a lot of the risk of redesigning the proverbial wheel. Of course even with the assistance Cocos was, it still didn't solve all the issues we had but luckily we were able to reuse a lot of the math work that we did for the surfaces in the level. In fact, the most difficult math came into play with adjusting player rotation after launching to a new surface. By dragging a line from the player to one of the level surfaces we calculate distance to the point of collision and once the player releases we launch them down that line until they land safely (or so they hope) on another surface. Getting the correct rotation required a healthy smattering of linear algebra and geometry but the less said about those dark times the better.[/font][/color]
[color=#000000][font=Georgia,]
Because controls dictate how the player interacts with the game they color his entire experience and directly affect his enjoyment. It is therefore important to make sure that the control scheme chosen matches the goals for the game.[/font][/color]
[color=#000000][font=Georgia,]
Reposted from Fixbot Blog[/font][/color]

Sounds interesting, but did you try letting the player handle the rotation. If they get it wrong SMASH, fixbot breaks into bits :-) Maybe another mode of play !!

@Lee Strip I think if I gave Joel another thing to change on his movment code he would kill me. ;) Your idea sounds awesome! Sounds like you have the start of your own game there.

Oh well, I think it would be interesting :-) Good luck guys.

## Create an account

Register a new account

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.