Tag Info

Hot answers tagged

12

You may want to keep an eye on Polycode. It is a 2D/3D framework written in C++ that has a complete set of lua bindings. Polycode is about to be rereleased with improved Lua bindings and a Lua IDE.


12

Since you are talking about screens, I feel it's best to separate all that logic into different Screens. What I normally do: Define an interface called screen, and have multiple screens implement it. Like LoadingScreen, MainMenuScreen, GameScreen, GameOverScreen, HighScoreScreen etc. In your game you put a variable that holds the current screen. Each loop, ...


9

Spawn the object at a random location on the side of the screen. Additionally, give it a initial direction/velocity of straight across the screen +/- random 20 degrees at whatever speed you want it to move. Finally choose a random target location on the opposite side of the screen. Now use steering to guide the object from its initial starting position and ...


7

LÖVE isn't as a library that you import into Lua. What it does is embed the Lua interpreter and expose its game functionality to that interpreter. If you'd like to interactive play with the API, there's a couple of libraries built for debugging and live coding: https://love2d.org/forums/viewtopic.php?f=5&t=2473 https://github.com/vrld/love-console ...


7

Disclaimer: I've created the two tutorials I'm going to link here I've done two tutorials. None of them is complete, but will get you from 0 to 80% quickly. The first one is a LÖVE-centric one called love-tile-tutorial: https://github.com/kikito/love-tile-tutorial It's about 50% done. Starts with the basics, and deals with Images & Quads, as well as ...


5

For a new promising 3D Lua based engine take a look at Maratis. It's coming long well, and currently targets PC, Mac and IOS. I'm personally looking at porting it to Android, and adding more 3D loading functionality. I have done a lot of searching for Lua+3D and this is about it when it comes to mobile platform targeting with minimal cost as well!


5

however there is not an awful lot of commercial games using PyGame, and I'd like to invest my time in the best way and ideally to make an extra buck in the future. And who cares? The toolchain is not what makes a game commercial or not, it's not what makes it a AAA title or not. PyGame will not prevent you from realizing your goal of creating a ...


5

Try out this tutorial: http://cupm.net/public/love2dtutorial/ It does a very good job of creating a simple game from scratch. I found this to be very helpful.


4

I don't know much about Love so I don't know if there is a built-in way, but you can change the icon of an executable file using a variety of icon editing software. Last time I did this in days of yore my weapon of choice was IconForge but I'm sure there are other tools available now (like these).


4

You want a stencil. Stencils let you flexibly define regions that love.graphics operations won't affect. Here's an example. It does this: Draw some colourful circles. Set an inverted stencil made of two triangles. Draw a black rectangle over everything. See how the black rectangle doesn't actually cover everything? It's cut out where the triangles ...


3

If you're already using Middleclass, there's an excellent state-machine library to go along with it called Statefull. It's easy to use and esposes the same ideas that Matsemann proposed.


3

You can get specific information about the image clicked by accessing the ImageData associated with the Image you're drawing. Specifically the getPixel function. When you detect a click, find which image is being clicked on. Then you need to get the ImageData you created for that image. Finally, convert the click coordinates to image local coordinates and ...


3

You have to create polygons with a counter clockwise winding in box2d. Have a look at the box2d manual, section 4.4 http://www.box2d.org/manual.html#_Toc258082970


3

Shiva 3D might be what you're looking for. Shiva 3D


3

I want to be a game developer... now what? This is a pretty comprehensive guide to starting out in game development, covering what languages are available, then a list of the most popular tools and libraries, as well as free and commercial book suggestions. Most of what is inside is completely free and provides direct download links. However, it is a ...


3

I don't think those games used a realistic sound perception model. Probably the best approach is to evaluate the distance between source and hearer and distribute the probability of state change in the enemy. A gaussian distribution would be perfect but heavy; you may divide the distance in tree ranges: near (always wake), far (never wake), middle (chance ...


3

that would mean that the entity factory has to be aware of the Rendering System If your entity factory function has to create objects for/from the rendering system, the obviously your entity factory function needs to create objects for/from the rendering system. There's no avoiding that; it's a part of what you need to do. A component system is not ...


3

I would strenuously urge you to give the player's ship retro-rockets to be used during braking. You really need to do that, because the alternative is for the computer to take over and automatically turn the ship to face away from its direction of travel whenever it decides that the player should stop. That'll be intensely annoying to the player, having ...


2

To run a game you made in Löve2D, you have to drag its folder (the one containing the main.lua) to the Love2D executable. It's the easiest way to run it. If you want to export you game into an executable itself, you have to package the folder and embed it into the Love2D executable. If you made a .love file, the same applies, just drag the .love file to the ...


2

From the easy to the scalable and complex to implement, kind of: A fast to write option is simply to let the HUD know where the player is and let it grab what variables it needs directly. It's not very flexible, but for games where the player is well defined and the scope of the game is tightly contained it can work well enough. This is a tightly coupled ...


2

I started using Lua and Löve a couple of weeks ago, I didn't find any good resource on getting started, I just used the wiki, it covers the very basics and then you can just use the documentation for the rest. It's not very different from any other 2D graphics API out there.


2

C++ scares me, however feel free to tell me how stupid I am You shouldn't fear c++ it is a great language. My goal is to make 2D games like Terraria, Super Meat Boy, DefCon, etc. Which language and tools should I choose to accomplish my goal? Awesome! You can do this in pygame, there's nothing wrong with that. Do you like programming in python ...


2

After playing around with this for a while, I finally discovered that my calls to enableMotor were wrong. I was just saying enableMotor() when what it actually needed is enableMotor(true)


2

You have access to the b2ContactImpulse in the PostSolve callback on the b2ContactListener. The normalImpulses field on b2ContactImpulse holds an impulse applied to both bodies in the direction of the contact normal. An impulse is calculated as a change in velocity times the mass of the object, so the normalImpulses well describes how hard the two fixtures ...


2

Yeah, vector geometry really helps when thinking about positions of things. It might be helpful to read over that page for a refresher. To find the vector from your object to the mouse position, subtract the object position from the mouse position: local objectToMouse = { x = mousex - object.x, y = mouseY - object.y } Then you can add some ...


2

Here's what I did that works for quick running. I created a main.lua file which has only one line require('main2') I put that file in a zip by itself, gave it the .love extension, and put it in the root of my project folder. Now, I can just double click that whenever I need to test. Then, main2.lua is my actual main file. You don't even need to make the ...


1

When setting the origin of a scaled image, use the original dimensions of the image instead of the final scaled size. For instance to set the origin to the center of a 200x200 image, you would use 100x100 even if it is scaled as the 'add' and 'set' functionality scale those values internally. Glad I could help ;)


1

Here's how I organize my states in Lua + Love2d. It avoids the long if/then statements. First, I create a basic class that contains an update(dt) and render() methods. You can also give it event handling methods, like onKeyDown(key). I call this class Stage, but any object that implements the methods will work. Then, I make an instance of that class for ...


1

If your current_state variable is a string, then this is really easy in Lua: game_states = {} function game_states.game() -- game stuff end function game_states.titlescreen() -- title screen stuff end -- then, inside the Update function: game_states[current_state]()


1

What I do is roughly as follows: I have a directed acyclic graph data structure, which is essentially just a bunch of nodes that point at each other. Each node represents a game system. e.g. the UI, the world, the input, the rendering. And each node points at other nodes that come before or after it. Once all the nodes are in place, it's easy to flatten it ...



Only top voted, non community-wiki answers of a minimum length are eligible