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

Add oval and ovalfill functions; update rnd function #89

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

troyjfarrell
Copy link

These commits update the API. The oval and ovalfill functions were added in PICO-8 0.2.1. The rnd(table) addition happened in PICO-8 0.2.0.

Copy link
Member

@Shoozza Shoozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello and thanks for the pull request! 😄
However there are some issues/suggestions with the new api calls:

  1. Resulting ellipse is different from resulting circ call:

    circ(5,5,5,2)
    -- vs
    oval(0,0,10,10,3)
    

    Maybe use a similar approach as in in api.circ

  2. Swapping x1,y1 and x1,y1 will result in a different oval

    ovalfill(0,0,10,10,2)
    -- vs
    ovalfill(10,10,0,0,3)
    

    Probably solvable with fixing the previous issue.

  3. Calling with true as a color will work in pico-8 but not with picolove, also calling with false will not use black but the last color:

    rectfill(0,0,128,128,3)  -- we want to see black lines
    color(2)
    oval(0,0,10,10)
    oval(0,0,10,10,true) -- color is 0 afterwards in pico-8
    color(2)
    oval(0,0,10,10,false) -- color is 0 afterwards in pico-8
    

    Maybe convert col to 0 if boolean.

  4. _ellipse could be a local function

@troyjfarrell
Copy link
Author

It seems to me that we have a larger problem. There are problems with the current implementation of circ and with my implementation of ellipse. Let's leave this PR open while I work out how to write some tests for this.

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

Successfully merging this pull request may close these issues.

None yet

2 participants