How to make an object turn and move left/right/up/down at the same time

Hi all,

Like the title says, how would I program an object to turn/rotate and move left/right/up/down at the same time?

All help is appreciated.

Thanks!

This is a really vague question because there are many different ways to move objects in Corona. Without seeing how you’re planning on moving the object, it’s going to be really hard to answer this.  Are you going to be using Physics?  Transitions? Are you moving these objects via programming (i.e. enemies in the game) or are these being moved by player interactions (touch events)?

Rob

If you’re using a known player movement style please name a game or games where the player moves this way.  Even better supply a YouTube video link of the game(s) and a time to look at in the video.

EX: Geometry Wars Retro Evolved movement example: https://www.youtube.com/watch?v=qDDIYHDk5mo at ~1:00 in video.

With that kind of info we’ll be much better equipped to help you.

@Rob Miracle I’ll be moving the objects via physics and programming.

@roaminggamer I can’t think of a specific game like this but it would be like those side scrolling platformers where the platforms move left constantly, only in my game the “platforms” would also spin at the same time.

local physics = require("physics") physics.start() local platform = display.newRect(200,100,20,5) physics.addBody(platform, "kinematic") platform:setLinearVelocity(-10,0) platform.angularVelocity = 10

The applicability of answers you will get to what you want to do, are directly proportional to the effort you put into asking your question.

Give us more and better details on what you want to do.

@roaminggamer Alright, I’ll try to be more specific. I want the platform to rotate around its center but move left like in a side scrolling platforming game. It’s like a top; the top just rotates around its center. But what I want to do is move the “top” left in a straight line while preserving the y value.

This is a really vague question because there are many different ways to move objects in Corona. Without seeing how you’re planning on moving the object, it’s going to be really hard to answer this.  Are you going to be using Physics?  Transitions? Are you moving these objects via programming (i.e. enemies in the game) or are these being moved by player interactions (touch events)?

Rob

If you’re using a known player movement style please name a game or games where the player moves this way.  Even better supply a YouTube video link of the game(s) and a time to look at in the video.

EX: Geometry Wars Retro Evolved movement example: https://www.youtube.com/watch?v=qDDIYHDk5mo at ~1:00 in video.

With that kind of info we’ll be much better equipped to help you.

@Rob Miracle I’ll be moving the objects via physics and programming.

@roaminggamer I can’t think of a specific game like this but it would be like those side scrolling platformers where the platforms move left constantly, only in my game the “platforms” would also spin at the same time.

local physics = require("physics") physics.start() local platform = display.newRect(200,100,20,5) physics.addBody(platform, "kinematic") platform:setLinearVelocity(-10,0) platform.angularVelocity = 10

The applicability of answers you will get to what you want to do, are directly proportional to the effort you put into asking your question.

Give us more and better details on what you want to do.

@roaminggamer Alright, I’ll try to be more specific. I want the platform to rotate around its center but move left like in a side scrolling platforming game. It’s like a top; the top just rotates around its center. But what I want to do is move the “top” left in a straight line while preserving the y value.