-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Supported tfm.exec.addParticleMethod method
- Supported tfm.exec.addParticle(particleType, xPosition, yPosition, xSpeed, ySpeed, xAcceleration, yAcceleration, targetPlayer) method - Created a new Particle class which could create particles easily - Added a new field particles under tfm.get.data. The particles table is implemented in the following structure ```lua particles = { all = {}, -- holding global particles head = nil -- holds the last spawned global particle [playerName] = { -- holds particles related to a particular player all = {}, head = nil } - Added test cases for both Particle.lua and for the new mthod under tfm.exec namespace related: #20
- Loading branch information
Showing
3 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
local typeAssert = require "extra.TypeError" | ||
|
||
return function(particleType, xPosition, yPosition, xSpeed, ySpeed, xAcceleration, yAcceleration) | ||
|
||
typeAssert('Particle', 'number', 1, particleType) | ||
typeAssert('Particle', 'number', 2, xPosition) | ||
typeAssert('Particle', 'number', 3, yPosition) | ||
|
||
return { | ||
particleType = particleType, | ||
xPosition = xPosition, | ||
yPosition = yPosition, | ||
xSpeed = xSpeed or 0, | ||
ySpeed = ySpeed or 0, | ||
xAcceleration = xAcceleration or 0, | ||
yAcceleration = yAcceleration or 0 | ||
} | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters