6
votes
Accepted
var=time() vs time()=var pico8/lua
In math, the = sign represents the equality comparison operator, an assertion that "the thing on the left has the same value as the thing on the right."
This operator is commutative: you can exchange ...
6
votes
Accepted
How do I get the player's position in Roblox Studio?
I feel your pain. Roblox is very confusing, despite their claims that it is an easy way to learn scripting.
To get a player's position (server side) you need to access the player's character ...
5
votes
Accepted
Love2D game and editor in two separate programs
Alright, found it !
I had to add this to the main.lua file in the editor folder and it worked :
package.path = package.path .. ";../?.lua"
require "core.engine"
4
votes
How can I correct an unwanted fisheye effect when drawing a scene with raycasting?
It looks like you're firing out your rays at evenly spaced angular intervals.
...
4
votes
Accepted
How to properly split damage against armor?
If I've understood correctly, I'd do this as a two step process...
Calculate how much the armor absorbs, then apply the rest to the player.
Something like:
...
4
votes
Handling status/effects on a turn based RPG game
My suggestion is to not overcomplicate things. I would just use flags to indicate that an entity has these effects and then apply their effects during events, e.g.:
...
3
votes
Create a game start-up menu screen with Lua/love 2d
There isn't a built-in menu system for love2d. The developers take a 'do-it-yourself' approach to a lot of such things.
Here's an example of how I ended up rigging my menu for my first time:
...
3
votes
Accepted
Implementation details of Command Pattern in conjunction with Entity Component System
How do I populate the execute command if there isn't any logic that
"belongs" to an entity?
But there is a mechanism for applying logic to an entity: Systems. In ECS, Systems map behavior to ...
3
votes
Any advantage of having chunks with sizes by the power of two?
The main advantage of power-of-two sizes is that division by a power of 2 (on an integer) is just a bit shift, and modding is just a mask. Both of these operations are blazingly fast to do on gobs of ...
3
votes
Optimizing falling sand simulation
This is how I parallelized falling sand:
The screen is divided into cells, 1 per pixel
The first kernel computes the direction each sand cell wants to go. Let's call this "push".
The second ...
3
votes
Accepted
How to fix diagonal velocity being greater than axis-aligned?
Is there a fix for this so no matter what of the 8 I travel its the same speed?
Yes... You want to apply a total force and split it between x and y
To do this for any angle, you apply ...
3
votes
How to fix diagonal velocity being greater than axis-aligned?
You use trigonometry. Here we can just use the Pythagorean theorem:
a² + b² = c²
If the player is moving at a 45° angle, a and <...
3
votes
Accepted
What does the phrase "Kinematic bodies do not collide with other kinematic or static bodies" mean?
Charanor's answer to your previous question already covered this point
https://gamedev.stackexchange.com/a/212552/174134
However for clarity in the video (you cited above):
Dynamic - Green
Kinematic -...
2
votes
AABB test does not consistently detect edge-to-edge contact when bounds are very different in size
This sounds like floating point precision error when testing for exact equality.
Let's model this in decimal to make it easier to read. Let's say we're using a decimal floating point format with room ...
2
votes
How to make the player unable to change some of the game elements?
You can use cryptography. But doing that in a way that actually prevents people from creating spells requires that you do not ship the private key to users, which implies either an internet server, or ...
2
votes
Rotate relative to set point in a specified direction in a 3D space
First of all, game engines and math go hand in hand so understanding the underlying theory should be high in your priority list. I will try to explain this at a high level, based on what I understood ...
2
votes
Accepted
Drawing rectangle with line's causes join artifact with the graphics api
You are drawing independent and unconnected lines.
What you probably want is a polyline.
You can get a polyline by passing in more than two points to the line ...
2
votes
for loop problem
Looks like this code runs after voting on a game mode. That probably means it doesn't run again until the match is over. My guess is that ...
2
votes
How to deal with rapid acceleration/deceleration from physics forces?
in case anyone's curious, I think I figured it out. I calculated a "terminal velocity" for a given engineForce, that is the speed where drag and the engine would balance out (in this case ...
2
votes
moving an object around a Circle
This is a pretty conventional application of a transformation matrix.
First, we need a matrix that translates the center of the gear to the origin:
$$\mathbb{T} = \begin{bmatrix}
1 & 0 & -C_x\\...
2
votes
Accepted
Why check the ball and brick collision twice?
The double check aspect of the code is discussed at this point in the video.
The first check lets you know that some sort of collision occurred. However, in order to bounce the ball correctly, you ...
2
votes
In my Roblox Tycoon game, my button is not working
Let's look at line 42:
if purchasedItems:WaitForChild(v.Dependency.Value) then
And next let's look at the documentation for Instance:WaitForChild():
This function ...
2
votes
How to express parabolic motion using delta time?
Disclaimer: You asked many different questions at once, which made your post too broad. Since this site is about making games, and parabolic motion in games is "objects falling due to gravity&...
1
vote
How to make the character dash forward in Roblox?
To answer your question would require a tutorial-length post. So many things come into play including Filtering Enabled settings. However, I can answer "How to make the character dash forward in ...
1
vote
How to make the character dash forward in Roblox?
It sounds like you're looking for BodyForce.
A good place to start on how it works might be the code in this video showing a simple script for a jump pad. The ...
1
vote
Command Shell text adventure - input methods for scrolling through text (lua)
This is not a super complete answer, but here goes:
When you expect your player to hit any key to continue, the classic way to tell them is end the prompt with "Hit any key to continue".
Now to get ...
1
vote
how to display current time as a static value in lua/pico8
You are doing it correctly by setting time() at a certain point as your own static variable.
Things you should know:
time() can ...
1
vote
Why is the button's code not running?
Taking a look at your script, we see that there is a little hick-up at the bottom of your function.
...
1
vote
Accepted
How to make object that moves with constant speed not overshoot the object it collides with?
At the moment you are checking for a collision between where the player is now and the goal square. Instead, you can define a rectangle which goes from where the player was last frame and where he is ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
lua × 257love2d × 53
c++ × 52
scripting × 26
roblox × 23
corona-sdk × 22
mathematics × 13
entity-system × 12
collision-detection × 10
2d × 9
physics × 8
architecture × 8
procedural-generation × 7
c# × 6
game-design × 6
ios × 6
component-based × 6
algorithm × 5
box2d × 5
tilemap × 5
java × 4
android × 4
3d × 4
rotation × 4
software-engineering × 4