Skip to content

Commit

Permalink
Merge pull request #11 from mitchwadair/development
Browse files Browse the repository at this point in the history
#9/#10: Optimzations & Reference Updates
  • Loading branch information
mitchwadair committed Sep 12, 2021
2 parents f09439b + 1026839 commit 1169a72
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
Binary file added build/SFramework_v0.3.3.cspack
Binary file not shown.
2 changes: 1 addition & 1 deletion src/SFramework/CS API Extensions/GameObject.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function GameObject:AddPhysics(colliderType, width, height, mass, static, bounci
if static ~= nil then defaults.static = static else defaults.static = false end
if bounciness ~= nil then defaults.bounciness = bounciness else defaults.bounciness = 0 end

return self:CreateScriptedBehavior(CS.FindAsset("SFramework/Components/PhysicsObject", "Script"), defaults)
return self:CreateScriptedBehavior(CS.FindAsset("SFramework/Components/Physics", "Script"), defaults)
end

--[[
Expand Down
6 changes: 3 additions & 3 deletions src/SFramework/Components/SpriteRenderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Behavior:Awake()
self.isAnimationPlaying = false

--functional vars
self.animCounter = 0
self.animCounter = 1

--construct
if self.gameObject.textRenderer == nil then
Expand Down Expand Up @@ -158,7 +158,7 @@ end
function Behavior:Update()
if self.isAnimationPlaying then
local newFrame = false
if ((self.animSpeed-1) / self.animCounter == 1) or self.animSpeed == 1 then
if self.animCounter >= self.animSpeed then
newFrame = true
self.currentAnimFrame = self.currentAnimFrame + 1
if self.currentAnimFrame >= self.numFrames then
Expand All @@ -171,7 +171,7 @@ function Behavior:Update()
end
if newFrame then
self.gameObject.textRenderer:SetText(string.char(self.currentAnimFrame + 32))
self.animCounter = 0
self.animCounter = 1
else
self.animCounter = self.animCounter + 1
end
Expand Down
16 changes: 0 additions & 16 deletions src/TestScript.lua

This file was deleted.

0 comments on commit 1169a72

Please sign in to comment.