Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to make an object turn and move left/right/up/down at the same time
Started by lorik.dominic Feb 19 2018 05:04 PM

- - - - -
8 replies to this topic
physics game help rotating
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

lorik.dominic

[GLOBAL: userInfoPane.html]
lorik.dominic
  • Observer

  • 7 posts
  • Corona SDK

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!



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,743 posts
  • Corona Staff

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



[TOPIC: post.html]
#3

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,120 posts
  • Corona SDK

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:  at ~1:00 in video.



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,120 posts
  • Corona SDK

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



[TOPIC: post.html]
#5

lorik.dominic

[GLOBAL: userInfoPane.html]
lorik.dominic
  • Observer

  • 7 posts
  • Corona SDK

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



[TOPIC: post.html]
#6

lorik.dominic

[GLOBAL: userInfoPane.html]
lorik.dominic
  • Observer

  • 7 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#7

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,205 posts
  • Enterprise

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


[TOPIC: post.html]
#8

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,120 posts
  • Corona SDK

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.



[TOPIC: post.html]
#9

lorik.dominic

[GLOBAL: userInfoPane.html]
lorik.dominic
  • Observer

  • 7 posts
  • Corona SDK

@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.




[topic_controls]
[/topic_controls]