Solarus-Games English Forum

Solarus => Development => Topic started by: zutokaza on April 07, 2017, 04:44:24 AM

Title: [Solved]Movements with camera?
Post by: zutokaza on April 07, 2017, 04:44:24 AM
I was trying to move the camera, but how do I move an entity without a name? Is it possible to create a name for the camera?

Code ( lua) Select
local straight = sol.movement.create("straight")
straight:set_angle(3)
straight:start(camera)
Title: Re: Movements with camera?
Post by: Christopho on April 07, 2017, 06:17:55 AM
Use map:get_camera()
Title: (Solved)Movements with camera?
Post by: zutokaza on April 07, 2017, 06:40:08 AM
Thank you Christopho! It works now.

Code ( lua) Select
local straight = sol.movement.create("straight")
straight:set_angle(3)
straight:start(map:get_camera())