Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local punchmod = RegisterMod("Punch!", 1)
- local punch = Isaac.GetEntityTypeByName("punches")
- local spawned = false
- testvar = 0
- function punchmod:spawn()
- local player = Isaac.GetPlayer(0)
- player.FireDelay = 2
- if not spawned then
- punchEntity = Isaac.Spawn(456, 0, 0, player.Position, Vector(0,0), nil)
- spawned = true
- end
- local sprite = punchEntity:GetSprite()
- if not sprite:IsPlaying("punch") then
- sprite:Play("punch", 1)
- testvar = testvar + 1
- end
- --[[sprite.RenderZOffset = 10
- sprite:Play("punch", false)]]
- punchEntity.Position = player.Position
- punchEntity.SpriteRotation = player:GetAimDirection():GetAngleDegrees()
- --testvar = tostring(sprite.RenderZOffset)
- end
- --[[function punchmod:animation(_mod, fists)
- local sprite = fists:GetSprite()
- if not sprite:IsPlaying("punch") then
- sprite:Play("punch", false)
- end
- end]]
- function punchmod:debugtext()
- Isaac.RenderText(testvar, 100, 50, 255, 0, 0, 255)
- end
- punchmod:AddCallback(ModCallbacks.MC_POST_UPDATE, punchmod.spawn, nil)
- --punchmod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, punchmod.animation, nil)
- punchmod:AddCallback(ModCallbacks.MC_POST_RENDER, punchmod.debugtext, nil)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement