Questions tagged as 'lua'

1
answer

Rewrite a simple game without using the sentence "goto"

In a part of the book I am reading I need to rewrite a "Labyrinth" game that uses goto sentences to another that does not use them. The labyrinth is very simple, it only has 4 rooms and it starts from room # 1: --------- | 1 | 2 | --...
asked by 22.03.2016 / 17:59
2
answers

Read a JSON file on ESP8266

I need help to read a JSON file in an esp8266, the esp must open the file by means of a code in LUA, read the data it contains to assign them to the configuration of the static ip. The json file contains the following: { "ip": "192.168.2.252"...
asked by 19.04.2016 / 01:27
1
answer

Rebounding angle of two Circles

How can I calculate the bounce angle between two circles ... ?? I use the following code to check and resolve collisions. -- CHECK COLLISIONS BALLS AND RESOLVE ... function CheckCollisionResolve(a, b) local dx = a.x - b.x; local dy...
asked by 08.06.2017 / 18:30
4
answers

AdmiralCloack.lua: 54: 'then' expected near ')'

function Cloaks:Init() if (file_exists)(Cloaks.DB) == false) then print('Creating Admiral Cloak Database') table.save({},Cloaks.DB, FILE_WRITE) end end     
asked by 10.09.2017 / 17:35
1
answer

Corona SDK: Avoid scoring 2 times at the same level

I want to avoid using a sentence, score 2 times at the same level of the game. This script controls access to game levels: local scene = storyboard.newScene() levels = { 1, 2, 2, 2, 2, --1 nivel abierto para jugar (level.png) 2, 2, 2, 2,...
asked by 05.11.2016 / 11:18
0
answers

how to send 44000 data by nodemcu (esp8266)?

My problem is at the time of doing the send the module is restarted. Apparently the buffer is filled with 1460 data it is necessary to find the way to send 44000 The connection I am using is UDP. How can I increase the amount of data I send?...
asked by 14.06.2016 / 18:26
3
answers

Delete PHP blank space

By php I generate and save a txt file that contains the data captured from a textfield, but when reading it from an application that I am creating it turns out that it has a blank space of more. How can I save my txt with the info lines I want...
asked by 20.05.2017 / 19:36
1
answer

Debugging Lua embedded in C ++

I am trying to integrate Lua with C ++ and I have some doubts when debugging errors . When any part of a lua script fails, whether it is a run-time error or a syntax error, Lua returns control to the host program quite silently. Basically...
asked by 15.04.2017 / 21:51
2
answers

Lua, table prints only nils

In a table I keep all the values that the user tells me with a for cycle, but at the moment of printing they only return nils for i=1,n do io.write("Por favor deme el valor de a" .. i .. ": ") a = io.stdin:read("*n") tablaA[i] = a...
asked by 07.09.2016 / 04:13
1
answer

How can I create sprite animations in a "grid-based" game in love2d?

I'm creating a pokemon game from 0 and I want to create the character movement style that it has. The tiles of the map tiles are 32x32, and those of the 32x48 character. Therefore, to move it you need to add 32 pixels to the X or Y of the cha...
asked by 05.09.2016 / 10:31