You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on the docs, I got the impression that Circle should have the same properties as Actor. So I ran into an problem where my code runs on actors using a.pos, but then it didn't work with Circles e.g. c.pos was "nothing".
Circle has the same API/properties as Actor.
Game objects on-screen are represented as Actors which have several associated attributes. Using Actors, you can change position, change the image and check for collisions. However, not all moving parts need to be Actors as those without a specific image can be defined as a Circle or a Rect, which have the same associated attributes (apart from image). Actors are usually the primary game objects that you move around.
GameZero.jl also includes basic geometric shapes. Rects, Circles and Lines can be used to do everything an Actor can, having the same attributes (apart from image).
This might also apply to Rect, Triangle, and Line as well.
Possible solutions:
Update the docs
Possibly create an API for how to interact with game object-like things, like Actor, Circle, etc., allowing one to set and get position, and other properties.
The text was updated successfully, but these errors were encountered:
. This is an inconsistency that should probably be fixed.
there's a question about what pos for a circle should return. It could be the centre, or it could be the topright of the enclosing rect. I think one could argue it both ways -- best geometric meaning, or consistency with Actors.
I think consistency is more important here, people should be able to do some for loop without having to worry if they get a circle or an actor.
There are the other properties to get the center.
Based on the docs, I got the impression that
Circle
should have the same properties asActor
. So I ran into an problem where my code runs on actors usinga.pos
, but then it didn't work withCircle
s e.g.c.pos
was "nothing".This might also apply to
Rect
,Triangle
, andLine
as well.Possible solutions:
Actor
,Circle
, etc., allowing one to set and get position, and other properties.The text was updated successfully, but these errors were encountered: