Computer Science, asked by eklavyajain3456, 9 months ago

What is the code for rotating a sprite in-game lab

Answers

Answered by Anonymous
1

Answer:

please mark as brainliest

Explanation:

Walking in a Circle

// Use sprite. rotateToDirection with sprite. rotation to make a sprite walk in a circle.

var sprite = createSprite(200, 200, 50, 50);

sprite. setAnimation("bunny1_1");

sprite. rotation = 180;

sprite. scale = 0.5;

sprite. rotateToDirection=true;

sprite. velocityX = 5;

function draw() {

Answered by riya1303
2

Answer:

Explanation:

sprite. rotationSpeed. Clockwise rotation change in degrees per frame of the sprite. A positive value will rotate clockwise, a negative value will rotate counterclockwise.

Similar questions