Skip to content

HW #21 #47

@chasestarr

Description

@chasestarr

In this homework we will solve the problem of turning objects in the direction of movement. Grab the mover class from here.

_Description:_
Use the arrow keys to apply a force to your mover object. Left arrow will push the mover to the left, up arrow pushes up, and so on. Use the rotate() function to turn the object in the direction of movement. Use velocity.heading() to calculate theta, or the movement angle. Below are some code examples that will help out. Take a look at this link for keyCode reference.

This image shows an alternate way of setting up the checkEdges() function.
screenshot 2016-04-06 14 51 14
This image shows how to implement one button in your code.
screenshot 2016-04-06 14 51 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions