Questions tagged [defold]

Defold is a multi-platform and light-weight game engine created by King. It’s designed for fast, efficient and collaborative game creation for independent developers and teams.

Defold is a multi-platform and light-weight game engine created by King. It’s designed for fast, efficient and collaborative game creation for independent developers and teams.

Defold comes with a full IDE for developing mobile apps.

28 questions
3
votes
2 answers

Lua - attempt to index local 'lvlObj' (a userdata value)

I am a newbie programmer, just starting out with lua and Defold, and basically I have a table called objects, and later in the code I am looping through the table using the method pairs, and in that for loop I try to access the item and use it, but…
David Wolters
  • 336
  • 2
  • 6
  • 18
3
votes
1 answer

How do I get input from a collection proxy in Defold

I have loaded a collection proxy but I receive no input on the scripts inside the proxy even if I have input focus on the loader object. I also receive no input on the loader object. This is the script that loads the proxy: function init(self) …
Erik Honn
  • 7,576
  • 5
  • 33
  • 42
2
votes
1 answer

How to tile part of texture in fragment shader

Using Defold game engine and it forces textures in the atlas to be a power of 2 (384x216 -> 512x256). Defold doesn't have support for parallax background and only options are: Managing multiple sprite positioning with code Manage it with shader on…
NeZvers
  • 110
  • 7
1
vote
1 answer

Run a string as lua code to call a function with only the function name

I am making a dynamic callback table for a helper function that handles input events. I want to make a(testString) execute when functionTable[1](testString) executes or allow a way for it to be run directly from a string. functionTable =…
Grify Dev
  • 60
  • 1
  • 11
1
vote
1 answer

Defold timer.delay function parameter

I am confused as to how to use the timer.delay function. I know the first parameter is the number of seconds of delay; the second is whether it should be repeated; the third is a callback function used after the timer has run down. By my…
1
vote
3 answers

LUA: Avoiding passing by reference

I'm just starting to learn LUA and I've got an issue that I'm unsure which way to "properly" solve. When I pass a Defold vmath.vector3 to my function it appears to be passed by reference and is therefore altered. If I multiply it by anything this is…
Ghork
  • 70
  • 8
1
vote
1 answer

Getting accelerometer input - Defold Engine

I'm trying to use the accelerometer to move the character. But with the use of action.acc_x / action.acc_y / action.acc_z inside on_input(), I can only get the information when there is also some other action being executed ("click", "left",…
Guilherme
  • 1,705
  • 1
  • 25
  • 45
1
vote
1 answer

Cursor not showing

As we develop a little game with defold (defold 1.2.102 | defold editor 2) we encountered the following problem: When we start our game the window shows everything we built properly and there are no build errors or error console logs. However there…
creyD
  • 1,972
  • 3
  • 26
  • 55
1
vote
2 answers

How to open downloaded project?

I've downloaded example project in defold site. it's zip file, how to import it to defold? Do I must create new project and drag all file into it? Sorry if this is beginner question, thank before.
Aep Saepudin
  • 172
  • 2
  • 5
  • 14
1
vote
1 answer

Unable to get the frog object to jump in the Defold getting started tutorial

I've completed the Defold tutorial upto Step5 and also the first 7 points of Step6. However, I when I hit space the frog object does not jump. I keep seeing the below messages in the console. WARNING:DLIB: Failed to send announce message…
Destroid
  • 112
  • 1
  • 7
0
votes
0 answers

How to make the condition of collision with an object and pressing a key?

I am slowly sorting out the engine and have run into one problem that I cannot solve. How to make the condition of collision with an object and pressing a key (for example, to enter the door) work. I do it in the object script: function…
0
votes
0 answers

Tile not being replaced when player collides with it

When codeing a game i wanted the player to hit a specific tile and when hit the tile would be replaced with a dofferent tile with in the same tilemap. This is the code: pos = go.get_position() x_tile = math.ceil(pos.x/16) y_tile =…
Cyion
  • 1
  • 1
  • 1
0
votes
1 answer

Defold set animation and cursor in a single run

Lets assume I have some input function which decides which direction to run. The atlas file being referenced to the game object has 8 (isometric) walk animations (same frame count, one animation per 1/8 rotation). Thus, if the rotation changes I…
hypnomaki
  • 593
  • 9
  • 22
0
votes
1 answer

how to get attack animation to work in lua?

local move_acceleration = 3500 -- acceleration factor to use when air-borne local air_acceleration_factor = 0.8 -- max speed right/left local max_speed = 450 -- gravity pulling the player down in pixel units local gravity = -1000 -- take-off speed…
0
votes
1 answer

Game crashes when using sound.play(url)

The game crashes when sound.play(url) is triggered. I am using Defold Version - 1.2.170 on Ubuntu 18.04 LTS. I have raised a detailed bug report here. The crash report is as…
Nevin Baiju
  • 305
  • 3
  • 18
1
2