Tagged Questions

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

0
votes
1answer
298 views

Love2D : Problem rotating image in a SpriteBatch

I'm working on a falling blocks type of game with triangular pieces. I'm using a SpriteBatch to accumulate and remember the pieces and their locations. The problem is that when I rotate a scaled ...
0
votes
1answer
472 views

C++ formatted serialization [closed]

I've decided it's time to implement serialization in my simple engine but this has caused me many headaches for the past couple of days/weeks. My engine uses an entity/component based approach similar ...
8
votes
2answers
2k views

How to use LuaJIT the same that Lua in a C++ program?

I'm using Lua in my C++ program, as an library. But I read that LuaJIT is a better implementation. Is it posible to replace with LuaJIT with little change? How?
6
votes
2answers
525 views

How to share Lua script between instances?

I'm doing an agent based framework with C++ and Lua. I want to use Lua to code the Agent behaviour having an AgentClass class that have the name and source code and an AgentInstance class that have ...
3
votes
1answer
190 views

Platform independent replacement for LuaInterface

I'm currently working on a project in C#/XNA, however I'm planning to migrate this to MonoGame so that it can go onto more platforms. The problem is that I am currently using a lot of Lua, and for ...
3
votes
2answers
706 views

Does it make sense to use Lua scripting in a game developed in Python?

Well for C++ written games using Lua scripts for easy changing ai, quets etc is very reasonable and it's common. However now I'm going to write a game in pure python and I don't know if I should use ...
2
votes
2answers
165 views

How might I script the creation of CLR objects?

I am looking for a method to script the creation of entities (arrays of components) for delivery through my entity factory, i.e scripted creation of .net objects. I have looked into Lua but it seems ...
1
vote
1answer
374 views

How can you implement Lua into your game? [closed]

I am trying to implement Lua into my game, but am having trouble. Say I have a weapon class, which is just a hollow shell, lacking real functions. I was thinking of creating an onFire function, which ...
3
votes
3answers
2k views

How should I manage the AI using lua scripts?

My game is in C++ and I want to make AI being managed by lua scripts, but I have no idea how should the scripts look like and the integration in C++. Should the script be like if ...
1
vote
2answers
149 views

Rotating and pitching a turret

I am new to game development and I was trying to build a turret model, and control it through lua script in shiva3d. I can rotate it around the y axis which is no problem, but when it comes to ...
1
vote
2answers
131 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 ...
3
votes
3answers
399 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 ...
2
votes
3answers
865 views

Is it efficient to use lua to store game data?

I'm new to lua and I'm wondering, is it efficient to use lua to store game data (such as monster's description, spells). My problem is, when I try to create a monster object every second, I have to ...
1
vote
1answer
123 views

Find connected hex of same color

I'm using Lua. I have a hex map. It is randomly generated into an table. hexmap[y][x].color = "red" I wish to find each "group" of hex's. i.e. all hex's of the same color that connect to each other ...
2
votes
2answers
458 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 ...
2
votes
1answer
160 views

Is it possible to have the main callback functions in different files with love2d?

Is it possible to have love.load(), love.draw() and love.update() in different files? and if so how would I go about doing that?
3
votes
1answer
152 views

Twitter integration

My computer game is powered using Love2d in Lua, there is dead space in the menu of my game and I'd like to fill it up with something. So I'll like to put a twitter feed there, how can I receive all ...
5
votes
3answers
1k views

How to protect Lua scripts in IOS game?

I'm developing an iOS game and was considering putting level info and monster info in a Lua script for ease of use. However, since I'm using Game Center for multiplayer I'm concerned users will ...
0
votes
2answers
598 views

Lua GameDev iOS - Code on win and mac

I am searching for a simple framework like http://getmoai.com where you can simply code a game in lua for iOS. I want to build it along with a friend. I am using a Mac, he prefers windows so the fw ...
0
votes
1answer
115 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
vote
1answer
373 views

How should I share variables between instances/classes?

I'm making a game using LOVE, so everything is programmed in Lua. I've been experimenting with using classes and object orientation recently. I've found out that a nice system to use is having most of ...
3
votes
2answers
3k views

Dynamic libraries are not allowed on iOS but what about this?

I'm currently using LuaJIT and its FFI interface to call C functions from LUA scripts. What FFI does is to look at dynamic libraries' exported symbols and let the developer use it directly form LUA. ...
4
votes
2answers
586 views

Basic procedural generated content works, but how could I do the same in reverse?

My 2D world is made up of blocks. At the moment, I create a block and assign it a number between 1 and 4. The number assigned to the nth block is always the same (i.e if the player walks backwards or ...
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 ...
4
votes
1answer
793 views

Lua or C++ in Cococ2d-x

I am going to use Cocos2d-x to make a game for Android and ios, but my question is, do I use the Lua integration or only c++, I see Lua useful here because the compilation thing. Or do I use only Lua ...
3
votes
1answer
658 views

Drawing an outline around an arbitrary group of hexagons

Is there an algorithm for drawing an outline around around an arbitrary group of hexagons? The polygon outline drawn may be concave. See the images below, the green line is what I am trying to ...
6
votes
1answer
127 views

Power Distribution amongst connected nodes

In my game the map is represented by connected nodes, each node has a number of connected nodes. The nodes represent a system in which players can build structures and move units about. If you're ...
2
votes
1answer
393 views

How can I link to callback functions in Lua such that the callbacks will be updated when the scripts are reloaded?

I'm implementing Lua scripting in my game using LuaBind, and one of the things I'm not clear on is the logistics of reloading the scripts live ingame. Currently, using the LuaBind C++ class ...
1
vote
1answer
247 views

Where in code to for collision? In object class? Mainline code?

Making a simple game in Love 2D framework where if I click on an object then it disappears. Do I check to see if I've clicked the enemy inside a function in the enemy object? Or just in my main.lua? ...
1
vote
1answer
360 views

what's wrong with this Lua code (creating text inside listener in Corona)

If you double/triple click on the myObject here the text does NOT disappear. Why is this not working when there are multiple events being fired? That is, are there actually multiple "text" objects, ...
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 ...
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 ...
5
votes
1answer
314 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 ...
4
votes
3answers
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 ...
2
votes
0answers
1k views

Opening URL in browser using C++ with cocos2d-x in iOS [closed]

I'm banging my brain against the wonderful lib xport that is cocos2d-x from the original cocos2d iOS library. What I want to ask is how to open a web link in the safari browser? I don' know how to ...
2
votes
1answer
759 views

Box2D + Love2D (Lua) - Assertion fail with polygon meshes

When I try to create a triangle collider for my game it sometimes leads to an assertion fail. I use the physics engine that comes with love2d (Box2D). That's the error message that appears when the ...
2
votes
2answers
643 views

Scripting language with class instance support

I have come across the need to use a scripting engine for my C++ game, but after experimenting with many languages since the last few days, nothing has truly stood out as the obvious choice for a ...
1
vote
2answers
5k 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 ...
5
votes
3answers
225 views

A* : Partial recalculation when one node *changes*

I have implemented an A* library. Its most interesting feature is that it is "interruptible"; for example, you can stop the calculation loop on a game frame, and resume it later on the following ...
10
votes
2answers
1k views

Handling scripted and “native” components in a component-based entity system

I'm currently trying to implement a component-based entity system, where an entity is basically just an ID and some helper methods tying a bunch of components together to form a game object. Some ...
0
votes
2answers
558 views

Is it possible to generate Events and Hooks in Lua for any game without built-in support?

Does a game have to have built-in functions to accept and run lua scripts, or can I design Events and Hooks using Lua on any game I please, akin to the days where C code could be used to hook into the ...
3
votes
2answers
974 views

How can I make a sprite move in the direction it's facing using radians?

I am using PGELua for the PlaystationPortable. I would just like to know how to make a 2D sprite move in the direction that the sprite is facing. When the sprite is blitted to the screen it should ...
6
votes
1answer
2k views

Fixing Slow XNA Game

I'm kind of new to XNA (and games in general). I'm trying to make a young relative of mine (10yo) a simple fun game where he is the main character. I'm down to the wire (I have to get it to him by ...
3
votes
2answers
2k views

Calling C++ functions in Lua

I'd like to use Lua to write some scripts which should allow me, given the state of certain variables of a specific instance, to determine a number to be assigned to a variable of that instance. Let ...
1
vote
1answer
132 views

Help with puzzle game

I have a pattern game and it is almost done however I am stuck on the last part. I have a screen with 25 blocks (in a table format 5x5) and the user clicks on it to turn over the blocks, I need to ...
2
votes
1answer
635 views

help animating a player in Corona SDK [closed]

Working on a game in the Corona SDK with Lua and I need help so the player animates on the line drawn. Right now he animates at the beggining and the end but not on the line. Here is the player code: ...
11
votes
3answers
2k views

Does Apple currently accept iPhone apps with embedded Lua?

I was researching this and I can't seem to find a concrete answer.
31
votes
5answers
9k views

What are the pros and cons of incorporating Lua into a C++ game?

I have a C++ game programming book and it has a Lua section in it. I've started to read the Lua section, and it sounds interesting, but I can't determine the pros and cons of using Lua in my C++ game. ...
2
votes
2answers
1k views

Game State Management using Lua

I want to be able to (only) define game states using Lua script, but I'm not sure how I should do it. Here's what I have in mind currently: For each state, I will create a .lua file that contains a ...
0
votes
1answer
366 views

How useful would it be to know a scripting language when developing an iOS game? [duplicate]

Possible Duplicate: Why do we use scripts in development? I just starting learning iOS game development. I plan to make games using the cocos2d framework. While reading game dev related ...