Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actor.right is incorrect ? #36

Closed
MarcMush opened this issue Apr 9, 2021 · 1 comment · Fixed by #46
Closed

actor.right is incorrect ? #36

MarcMush opened this issue Apr 9, 2021 · 1 comment · Fixed by #46

Comments

@MarcMush
Copy link

MarcMush commented Apr 9, 2021

While trying out Flappy Bird and tinkering with it, I stumbled accross some strange things.

we have actor.right < actor.left:

(pipe_top.right, pipe_top.left) = (228, 328)
(pipe_top.right, pipe_top.left) = (225, 325)
(pipe_top.right, pipe_top.left) = (222, 322)

it seems like right is computed as left - width. shouldn't it be left + width or am I missing something ?

getPos(::Val{:left}, s::Rect) = s.x
getPos(::Val{:right}, s::Rect) = s.x-s.w
getPos(::Val{:top}, s::Rect) = s.y
getPos(::Val{:bottom}, s::Rect) = s.y-s.h

EDIT: same thing for bottom

@aviks
Copy link
Owner

aviks commented Apr 9, 2021

Hmm.. I thought I'd tested this -- will check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants