Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

SSK2: Moving an object but not using its current facing
Started by santiagoluib3 Oct 13 2017 05:14 PM

6 replies to this topic
[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

santiagoluib3

[GLOBAL: userInfoPane.html]
santiagoluib3
  • Contributor

  • 181 posts
  • Corona SDK

Hi Ed,

 

With SSK, is there a way to move an object regardless of where it's facing at... (eg. just move the obj to a vector even if it isn't facing the vector)?

 

Santi

 

 



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,516 posts
  • Corona SDK

There are a number of ways to move objects with the ssk.actions.* lib.

 

ssk.actions.* Part 1 - https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/actions1/

ssk.actions.* Part 2 - https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/actions2/ 

 

 

Move w/o Physics -  https://roaminggamer.github.io/RGDocs/pages/SSK2/libraries/actions1/#non-physics-movement-move

 

If you want to move with physics in a fixed direction at a fixed rate (not forward), you don't need SSK2 at all just use set.linearVelocity().

 

If you simply want to move something by a fixed amount, again you don't need SSK2.  Just use obj:translate(x,y).

 

Note that the actions library only adds complex and non-existent features to the mix.  If pure Corona can do it already, I did not add it.



[TOPIC: post.html]
#3

santiagoluib3

[GLOBAL: userInfoPane.html]
santiagoluib3
  • Contributor

  • 181 posts
  • Corona SDK

Sorry I didn't elaborate on my question.  I agree I don't need SSK2 just to move objects around.

 

What I actually meant was:  I already have existing code in my game using SSK2 where some objects follow (chase) another object(s), using actions.movep.forward() in conjunction with actions.face().   Trying not to change much on the code, I was wondering if I could make a variation where those objects still chase their "targets" without facing them.

 

But yes, I could switch to pure Corona way of doing it otherwise.

 

Thanks

Santi



[TOPIC: post.html]
#4

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,516 posts
  • Corona SDK

You can do this, but there are a few steps.

 

I'll give this a going over tomorrow and post the code you need.

 

-Ed



[TOPIC: post.html]
#5

santiagoluib3

[GLOBAL: userInfoPane.html]
santiagoluib3
  • Contributor

  • 181 posts
  • Corona SDK

Thanks a lot Ed,  when you have the time.

 

It's the convenience of using your functions that I prefer using it.  It gives me more time to focus on game/level design than meddling with code ;) 

 

-Santi



[TOPIC: post.html]
#6

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,516 posts
  • Corona SDK

I came up with a couple of options.  The aren't in the official action.* lib yet, but you can get the update for movep.* here:

 

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/10/moveWOFacing.zip

 



[TOPIC: post.html]
#7

santiagoluib3

[GLOBAL: userInfoPane.html]
santiagoluib3
  • Contributor

  • 181 posts
  • Corona SDK

Awesome!  Thanks a lot @Ed.

Your support is always very much appreciated.  

 

-santi




[topic_controls]
[/topic_controls]