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.
4
votes
4answers
1k views
How can i run my .LÖVE game directly from the lua interpreter?
I've just started with LOVE and LUA , i'm interested in LOVE because i want to play around with something different from my dayjob(i'm a webdeveloper) and since it uses LUA and is interpreted , i ...
0
votes
1answer
56 views
how to close lua file call luaL_dofile?
i created tool that generate lua script on each level which contain lot function, and they named based on the object+id format. ex : trigger1(), etc; so every level may have same function name, what i ...
0
votes
0answers
40 views
Calculate future 3D Position of object(Unit)?
I've looked around and almost all examples is see have a velocity vector which I do not have, or at this point am unable to figure out. Im trying to find the 3D position where i can launch a trap in ...
1
vote
0answers
73 views
Scripting language for high complex educational game [closed]
I'm at a stage of working at my C++ game that I need to implement a script language to allow the players to perform tasks inside the game's logic. I'm a sole programmer and thus it's entirely ...
1
vote
1answer
102 views
Handling creation of entities on level creation
I'm currently working on a 2d physics based plat former, kinda in the style of super meat boy. In super meat boy, you have multiple levels and I want a similar sort of thing but is there a general way ...
0
votes
1answer
59 views
NLua - How to implement Roblox like function security?
Roblox uses Normal Identities, basicly they assign a lua block/object to a certain number. They use 2 for Scripts and LocalScripts, which can only use non-secured functions, while the command bar can ...
5
votes
2answers
352 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 ...
0
votes
0answers
48 views
How do you use Lua with several game objects / components?
I haven't found a lot of information / tutorials on this subject, so I figured I'd ask here.
I would like to use Lua-Alchemy (the Flash port of Lua) to be able to load scripts and run console-like ...
3
votes
1answer
771 views
Is it possible to develop a game with Lua/Löve and have the source code compiled? [closed]
I've been looking at Lua and Löve for developing simple 2D games. But since Lua is interpreted and I know it can be compiled to some point, but how secure is that to decompiling. Or is there a better ...
1
vote
2answers
147 views
update image properties
Is there a way to update the location of an image?
I'm currently calling my image dynamically using:
itemImage = display.newImage(inventory[t.ID][1])
t. being my target ID.
But in order for ...
1
vote
1answer
73 views
Custom 3D Noise function incorrectly generating in Lua
I have been working on a custom noise generator (not Perlin on Simplex or whatever), which works fine in two dimensional space, but upon converting it into three dimensional space, it turns into a ...
2
votes
3answers
112 views
Building a C-E engine in a high level language, how can I integrate optional lower-level components that own overlapping state?
To clarify, by overlapping I do not mean overlapping between said components, but rather, let's say I have:
My entity contains components, and a parent-children system. Call it a mandatory Hierarchy ...
0
votes
0answers
139 views
Touch-detection in cocos2d-x (Lua): Catering for bounding boxes and scale factor
I am trying to write an app in Cocos2d-x with Lua.
I have a sprite that I have added directly to a scene, and now I want to detect touches on the sprite.
Right now, my touch begin function looks as ...
1
vote
2answers
472 views
How to run multiple Lua scripts within the same lua state without conflict
I've been working with Lua for sometime and there is a problem that I could never solve it. First, I'm using a single lua state to have a connection between my scripts so they could transfer data via ...
0
votes
0answers
13 views
Lua mud using c snippet for protocols? [duplicate]
I've been working on teaching myself to program in Lua for the past couple of months and I've been working on my own MUD using lama as my starting point. I've learned a lot and added quite a bit of ...
5
votes
1answer
350 views
How do I change a LÖVE2D game executable's icon?
I merged my game.love file and the love.exe with the command copy /b love.exe+app.love game.exe. But the resulting executable has the default LÖVE2D icon.
Is there a way to change that icon to ...
3
votes
2answers
784 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:
...
1
vote
1answer
787 views
Run Love2D on iphone and android
I have a game developed in lua using love 2d, and now i want to run it in ios/android.
Is there any porting or way available to do that.
Thanks.
1
vote
1answer
123 views
Love2d: Failed to load tileset map
I'm reading the Love2D Development book, which i think i will stop reading because is outdated and very instable, sometimes i got a lot of troubles. Backing to the question, i made a tileset map with ...
0
votes
2answers
111 views
Switching a project written in Lua to a compiled language [closed]
I am experimenting with game development in Lua using the Love2D framework, and while it works fine, I am getting tired of using a dynamic scripting language. I would like to have better performance, ...
16
votes
7answers
3k views
Is there any Lua API that works with C# for PC & XBox 360 Development?
I am reading a book on Game Development in which they show you how to make scripts for your game in Lua. They program Lua and use it from C++, but I was wondering if there is a library or API to use ...
2
votes
1answer
878 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
806 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 ...
3
votes
1answer
670 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
2k 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
545 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
262 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
71 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
208 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
127 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( ...
42
votes
6answers
9k 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
93 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
136 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
121 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
87 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
152 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
125 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
43 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
313 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
4k 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
408 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
138 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
317 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 ...
2
votes
1answer
146 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
1k 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
3k 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
425 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
185 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
101 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
124 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 ...