Several Questions

Hi all,

so im new to dev and Defold in General.

I have a few question, i did go through the tutorials and the manuals AND… i did search the forums but im think lots of what was said sort of went over my head a bit!!!

So question …

  1. Instead of using mouse or keybinding inputs and i use an accelerator to move my player around? (i did see some release notes that said accelerator support)

  2. I have a sprite lets say its 600 x 200px. it is to big on screen, is there a way of being able to scale it down without remaking the sprites in Photoshop or illustrator?

  3. the main programming language in Defold is Lua, correct? - just want to make sure im reading the right tutorials or books.

thanks very much in advanced.

1 Like

Accelerator
Yes, you can use the accelerator on mobile devices:

function on_input(self, action_id, action)
    -- Accelerometer values will end up in the acc_x, acc_y and acc_z variables.
    print(action.acc_x, action.acc_y, action.acc_z)
end

Sprite scaling
When you assign an image from an atlas to a sprite you have the choice of changing the scale of the sprite. See the 2D Graphics section of the manual.

Lua
Yes, Lua is the language you use for all your game logic. The Lua 5.1 manual is a really good starting place. As is our own Lua section in our manual pages.

1 Like

I have not tested this - does using Accelerometer data require having a touch_trigger input ever time you want that data?

1 Like

No, you should always get accelerometer data on mobile devices.

2 Likes

Fantastic!!! thanks very much.

1 Like

Pluralsight.com has a decent Lua tutorial on it. You should be able to watch it using the free trial.
Check out SetTheBet’s videos on Live Coding https://www.livecoding.tv/videos/?q=setthebet
the idea of Live coding is good, but the site isn’t great and you need Flash to watch the videos. Content is good though :slight_smile:

3 Likes

Those SetTheBet videos do have many insights! I’ve been watching them since starting with Defold. You can download the flv files and then watch in something like VLC - watching on the web can be laggy and randomly drop for me. It would not be impossible to mirror the videos onto YouTube or to be directly downloadable from somewhere just take time for someone to download the flvs and then upload if it was okay with Andreas.

5 Likes

I would also recommend checking out SetTheBet on Livecoding. He’s an excellent source of knowledge and inspiration, and that from someone close on the engine. In addition to learning the the engine and Lua, you may also be able to pick up small insights, like how to structure your projects and similar small quirks. A top source of information! :+1::blush:

4 Likes

Thanks all!

I did have a look on pluralsight, there is a really good in depth course on there.

I will check out the other links provided too!