Hot answers tagged

13

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, ...


13

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.


10

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 ...


7

I suspected OP already knew this approach so I mentioned it in a comment as just a starting point, but I'll try fleshing it out a bit more... Most physics engines divide dynamic objects into two groups, "awake," and "sleeping." Objects sleep when they sit at rest, and wake when moved or accelerated by some outside influence. A sleeping object behaves like ...


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.


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!


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

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.


4

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 ...


4

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 ...


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

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 ...


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

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

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

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 ...


3

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


3

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 ...


3

Directly editing the position of a box2d body will produce non-physical behaviour, it's present because sometimes you will need to teleport bodies to a far away location, or reset the position of an object without the need to destroy/re-create it, etc... In your case the joints are not handling the position adjustments well. The setPosition function should ...


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

The steps below are also covered in a video tutorial (icon topic starts at 2:22). Create an .ico file using GIMP, you can use the game.ico or love.ico included in the 32bit redistributable of LÖVE as a template. Rename your .exe file to nonsense.exe (explanation below). Drag the .exe file into Resource Hacker, unfold Icon Group and right-click the only ...


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 ...


2

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]()


2

Make a sprite factory (preferably inside another rendering-related structure, like the renderer). It can internally be capable of ordering and grouping sprite data as required for batching.


2

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

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)



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