aviks / GameZero.jl

Zero overhead game development library for the Julia programming language
Other
184 stars 23 forks source link

`actor.right` is incorrect ? #36

Closed MarcMush closed 3 years ago

MarcMush commented 3 years ago

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 ?

https://github.com/aviks/GameZero.jl/blob/938cc41b34f8ffd9c453ddb9fcd3da8ea67adf4a/src/screen.jl#L87-L90

EDIT: same thing for bottom

aviks commented 3 years ago

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