Skip to content

When creating a rectangle, wants to create a polygon instead and gives me an error #75

Description

@Okasan524

this is what happens

--this works fine
rect = HC.rectangle(100, 100, 64, 64)

--but if want to create a rectangle using a table for e.g.
player = {}
player.x = 100
player.y = 100
player.size = 64

player.rect = HC.rectangle(player.x, player.y, player.size, player.size)

 -- gives me this error v v v

--[[
Error

HC-master/polygon.lua:145: Need at least 3 non collinear points to build polygon (got 0)


Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'assert'
HC-master/polygon.lua:145: in function 'construct'
HC-master/class.lua:77: in function 'instance'
HC-master/shapes.lua:439: in function 'newPolygonShape'
HC-master/init.lua:86: in function 'rectangle'
main.lua:59: in main chunk
[C]: in function 'require'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
]]

happens when using values from a table in the arguments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions