Giter VIP home page Giter VIP logo

Comments (6)

Anut-py avatar Anut-py commented on September 18, 2024 1

Actually, I think the random number is because raycollision'hit uses CInt instead of CBool, so raycollision'hit returns garbage as the first 24 bits. #3 was a similar issue. That should be an easy fix. The main problem is that you have to print something for it to work properly. I think implementing the collision detection logic in Haskell is the best way to fix it.

from h-raylib.

Ashe avatar Ashe commented on September 18, 2024 1

Fixed, thank you for the quick fix and your hard work. Loving the bindings so far! Have a good one!

from h-raylib.

Anut-py avatar Anut-py commented on September 18, 2024

I will look into this. The functions should be okay for unsafePerformIO, but if it turns out they aren’t then I’ll implement collision detection math manually in Haskell. I would like to keep IO out of these pure functions.

from h-raylib.

Ashe avatar Ashe commented on September 18, 2024

It could be something else entirely, maybe I'm being suspicious of the wrong thing so feel free to correct me if I'm wrong! But this is the first time I've found something like this in Haskell so I'm a bit perplexed!

from h-raylib.

Ashe avatar Ashe commented on September 18, 2024

Are you sure that print is required? Maybe after changing CInt to CBool things will start working as you expect?

When you say moving the detection logic into Haskell, wouldn't that be essentially avoiding using Raylib? If that's the case then probably best to just flag it somehow so that people can write their own; I wouldn't say its the responsibility of your repo to re-implement things when it's just meant to be bindings.

from h-raylib.

Anut-py avatar Anut-py commented on September 18, 2024

I changed CInt to CBool in version 4.5.0.5. I tested it and it seems to be working fine with some example code. If this fixed the problem for you, you can close this issue.

from h-raylib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.