Lua is a powerful, fast, lightweight, embeddable scripting language. Lua is widely used as a scripting language by game programmers, perhaps owing to how easy it is to embed, its fast execution, and its short learning curve.

learn more… | top users | synonyms

2
votes
0answers
101 views

Lua Implementation

I'm struggling to get Lua implemented into my game engine. I've read dozens of blogs and articles revolving around how to wrap C++ classes and I seem to have hit a wall. No matter how I structure the ...
2
votes
1answer
109 views

Generating transformation matrix for 2D camera with pan/zoom/rotate

Question How do you implement a camera with pan/zoom/rotation for a 2d game? Is it acceptable to multiply together a series of transformation matrixes to generate a final transformation matrix that ...
2
votes
1answer
775 views

Help with Collision of spawned object(postion fixed) with objects that there are translating on screen

Hey guys I am creating a game using Corona SDK and so coding it in Lua. So there are 2 separate functions, To translate the hit objects and change their color when they are tapped The link below ...
2
votes
2answers
575 views

How to bind std::map to Lua with LuaBind

Is this possible in lua to achieve? player.scripts["movement"].properties["stat"] = "stand" print (player.scripts["movement"].properties["stat"]) I've done getter method in c++ with this approach: ...
2
votes
1answer
159 views

How can I manage entities(in entity component system) using Lua scripts?

Suppose I have a code like this in C++ // Game.cpp Entity* hero; Entity* witch; ... // entity initialization if(/player near witch/) { if(hero->get<HealthComponent>()->getHealth() ...
2
votes
2answers
1k views

How do I draw a border around a display object in Corona Lua?

What would be the easiest way to draw a thin border around a display object in Corona Lua? You could assume it's rectangular image display object. EDIT - re "this question shows no research ...
1
vote
1answer
418 views

Love2D : How can I keep up with lots of small sprites' collision data?

So I'm using a SpriteBatch to keep up with lots of small pieces for a falling-piece puzzle game. I have an array of Quads (for different color blocks), and they are randomly added to the ...
3
votes
1answer
51 views

Make an object follow the mouse pointer with LÖVE2D

I've been trying to make a picture follow the mouse pointer with LÖVE2D. I want that the object follow the mouse, and not just be the mouse coordinates, I did that. So I toked the distance between ...
0
votes
1answer
38 views

Phone crash when try to use vibration on Android

Im developing an app that when you click a button the phone has to vibrate, the issue is that the phone just chashes. Saing that I need permitions to vibrate. I've already set this permition in the ...
0
votes
2answers
135 views

Smooth moving on tile-based map, how to fix simple collisions?

I've already had some experiences about the work of 2 dimensional square-based playfields and moving a player on them. Though, when a square has multiple pixel sizes, and player moves e.g. 1 pixel per ...
0
votes
1answer
39 views

file:write restarts Corona app

I am attempting to implement an auto-save feature into a mobile game. I have the following code writing to the save file: function saveFunc(input) local saveData=input local file = io.open( ...
37
votes
7answers
5k views

How does Lua work as a scripting language in games?

I'm a little hazy on what exactly Lua is and how a game that is programmed in C++ would use it. I'm asking primarily about how it is compiled and run. For instance when you use a program written in ...
0
votes
0answers
49 views

Gideros Repeating and Clipping Background

I want to have a background with a repeating x-axis, that can be moved horizontally. What I have so far: local background = Texture.new("parallax01.png", true, {wrap = Texture.REPEAT}) local shape = ...
1
vote
2answers
100 views

Is it possible to develop web-based games using Corona SDK?

Some clients asked me to develop 2D web-based games and later on they might want to release those games on mobile platforms. I know Corona and I don't want to rewrite my code twice. Is it possible to ...
1
vote
1answer
85 views

How should I go about protecting my script files?

I am working on a small multiplayer game with a whole bunch of scripting components. I know I can't store my files in plaintext otherwise anyone would be able to change the functionality of core ...
0
votes
1answer
78 views

How do I lock drawn lines to be orthogonal to an existing one?

I'm making a 2D game in Corona for Android/iPhone that is similar to Volfied. In my game, the user has to touch the screen to draw a line for the character to move along. How can I force the lines to ...
1
vote
2answers
103 views

Using Lua for configuration and localization data

Since my game is already going to be scripted with Lua, I've decided to make all my configuration and localization data defined using Lua tables. For example, this could be a basic locale file: -- ...
0
votes
1answer
85 views

How should I organize Lua scripts so that some entities do not have access to functions they shouldn't?

For my game in C++ I'm using different objects (like player, enemy, et cetera) which will have to be controlled by a Lua script. My problem is that if I were to write a function in my player script, ...
0
votes
0answers
42 views

Checking if two lines are crossing [duplicate]

How can I check if two lines (created with function love.graphics.line) are crossing themselves? I may use this ability to create procedural maps via graphs.
1
vote
2answers
235 views

Perlin Noise Help

Okay so I have been trying to make perlin noise, fractal noise to be specific, with mixed success. What I do is I fill 5 arrays with white noise, basically just floating point values. Each array is ...
1
vote
1answer
2k views

2D and 3D Perlin Noise Terrain Generation

I'm using 2d perlin noise to generate a heightmap and then adding 3d perlin noise to the heightmap to create overhangs and ridges. But it's not turning out like I would like it to. There are too many ...
3
votes
3answers
391 views

Automatically triggering standard spaceship controls to stop its motion

I have been working on a 2D top-down space strategy/shooting game. Right now it is only in the prototyping stage (I have gotten basic movement) but now I am trying to write a function that will stop ...
1
vote
0answers
92 views

Determine required camera pitch/yaw change based on mouse movement and roll?

I'm sure this is going to be a pretty simple answer but I can't quite figure it out on my own. Each frame, I'm getting the mouse's distance from the center of the screen (left/up is positive) and ...
1
vote
2answers
182 views

Perlin Noise Variations

Currently I'm making a voxel survival game. About a month ago I embarked on procedurally generating terrain using Perlin noise. I understand how to use and apply it for the most part. However I do not ...
1
vote
1answer
103 views

How to set speed based on screen size

I am making a breakout clone for mobile and was wanting to make the ball speed to be related to the screen size. Larger screen would mean faster speed. Right now I have it set like so: ...
1
vote
3answers
654 views

corona sdk scale images

How to scale images to full screen on all devices, i want to use % The method I've seen so far is to define pixels image_variable_name = display.newImage( "testimage.jpg", 100, 300 ) I want to do ...
3
votes
3answers
2k views

How do I move an existing display object behind another in Corona Lua?

If I have two existing display objects in Corona, lets say do1 and do2. Assume do1 is drawn first then do2, so do2 will be on top. Is there a way to say "put do2 behind do1" in corona Lua? If yes can ...
1
vote
1answer
287 views

How to store generic data in game database?

To clarify things a bit: I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc. The main problem I ...
1
vote
2answers
128 views

LUA - Keeping track of game state for a digital card trading game

I am building a card game. Let's say it's similar to Magic the Gathering, Hearthstone, etc. The problem I am trying to figure out is how to architect "auras" and how much damage each card takes. ...
2
votes
2answers
84 views

Breakout intersection logic issues

I'm learning Lua and thought I should try my hand at making a Breakout clone. It is pretty much playable, but there seems to be odd intersection logic at some points, specifically the ball-brick ...
1
vote
1answer
108 views

How to allow other games to communicate with my Lua scripts?

I am planning some small games that will all rely on a single system of Lua scripts to manage some unified data about: Some achievements that are common to each game. The player's progress in ...
1
vote
0answers
41 views

Overlay scene not showing

I have 2 scenes: One main scene with a button, and another scene with only 1 text. button action in Main Scene: local options = { effect = "fade", time = 400, params = { ...
1
vote
0answers
34 views

Verb+Noun Parsers and Old School Visual Novels [duplicate]

Hi I'm working on a simple old school visual novel engine in Lua. Basically I have most of the code set up besides one important feature. The Text Parser. Lets get into how words are generally ...
1
vote
2answers
4k views

Efficient tile maps in Corona SDK

I need to create a tile map based level system for Corona SDK that loads files created with Tiled [1]. It also needs to support user touch scrolling and zooming. I've searched the Corona forums for ...
3
votes
1answer
425 views

How to transfer a luabind::object between two lua states

I store an object by a function call from Lua to C++ in first script in my application and after that I'll try to pass that object to other scripts and vice versa. A part of script class in C++: ...
1
vote
2answers
177 views

Store voxel type data in XML or Java classes?

So, I want it to be very easy to create all the entities of my game and for other people to come in and do the same. I was thinking I could just let the users/myself create an XML sheet the stores all ...
2
votes
2answers
427 views

Viewport like Angry Bird in Corona

Not sure if that's the right name for it, but I'm looking for a way to implement zooming in my game. Essentially the game should zoom in on my character during the moving and shooting phase (its like ...
11
votes
8answers
15k views

Love2D engine for Lua; What about 3D? [closed]

Lua has been really awesome to learn, it's so simple. I really enjoy scripting languages, and I had an equally enjoyable time learning Python. The Love engine, http://love2d.org/, is really awesome, ...
5
votes
2answers
333 views

How to keep Lua bindings from cluttering up C++ code? [closed]

I'm writing a game engine that uses C++ and Lua (and Luabind). Currently, I'm writing all the bindings inside the constructor of the class being binded. I really don't like this because it's ...
1
vote
1answer
105 views

Starter love2d physics program not working

I am starting out with my first love2d (using LöVE 0.8) physics program. I am just creating some ground/floor, a car body and attaching two wheels with revolute joints and setting the motors a-go. ...
2
votes
1answer
337 views

Scripting a sophisticated RTS AI with Lua

I'm planning to develop a somewhat sophisticated RTS AI (eg see BWAPI). have experience programming, but none in game development, so it seems easiest to start by scripting the AI of an existing game ...
7
votes
6answers
1k views

Game state management (Game, Menu, Titlescreen, etc)

Basically, in every single game I've made so far, I always have a variable like "current_state", which can be "game", "titlescreen", "gameoverscreen", etc. And then on my Update function I have a ...
1
vote
1answer
347 views

how to link a c++ object to a local variable in Lua

I'm completing my scripting interface with Lua, but recently I've stuck at some point. I have several functions for my Entitiy events like Update(). I have a function called create_entitiy() which ...
2
votes
1answer
285 views

Game Development AI, NPC & Entities Definition using Scripting Languages

i am developing a Multiplayer(actually MMORPG) architecture for learning purpose. I do have some game developement background, but all my engines were very rigid and completly developed for the game ...
2
votes
1answer
144 views

How does one update the physical state of an object after scaling it in Corona?

I am new to Corona and Lua. I have the following question: I have an object cake with these physics parameters (doesn't really matters): ["cake1"] = { { ...
2
votes
1answer
3k views

why lua is so important ( frequently used ) in game development [duplicate]

I wrote some small games for fun myself, and never used LUA myself. but I can see people discussing lua used in games everywhere. I don't know what benefit I can get from using LUA in game ...
4
votes
2answers
900 views

Experience embedding javascript

I'm looking into scripting languages to embed in my game. I've always assumed Lua was the best choice, but I've read some recent news about embedding V8 as was considering using it instead. My ...
0
votes
1answer
102 views

Why does this LUA code not render any objects on the screen? [closed]

Did I mess up something somewhere? If i put a putsxy in the same box, it renders a string just fine, but for some reason this code hates objects. What this code is supposed to do is render a set of ...
0
votes
1answer
111 views

using lua in kobold2d to control parameters

Is there a tutorial on using LUA in Kobold2d? I want to know if its possible to use it to control the game behavior (like max speed decrease of timer, and bonus points) by uploading a new script to ...
-1
votes
1answer
270 views

Overload C++ functions in lua [closed]

I have had a look around but I believe this to be impossible due to compile time of c++. However is it possible to have a class registered in lua and c++ that has a overload update function which I ...