Comments (6)
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.
Fixed, thank you for the quick fix and your hard work. Loving the bindings so far! Have a good one!
from h-raylib.
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.
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.
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.
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)
- More abstraction for WindowResources passed to load/unload* functions? HOT 1
- `clamp` function in Raylib.Util.Math can be more haskellish HOT 1
- Add script file to update raylib git ref in flake.nix
- Add support for raygui HOT 2
- Windows - GCC missing libs error HOT 1
- Add nix build in GitHub actions
- Add bunnymark example
- `5.1.1.0` release checklist
- Incompatible with latest base versions (anything above 4.18.2.0) HOT 2
- Module ‘Raylib.Util’ does not export ‘raylibApplication’ HOT 2
- Drag and drop does not work as expected HOT 2
- defaultWindowResources is undocumented HOT 3
- Pure version of `getScreenToWorld2D` function in rcore HOT 1
- `unloadImage` is missing in `Raylib.Core.Texture` HOT 1
- The function loadDroppedFiles
- Expose Raylib.Internal module HOT 1
- Provide low-level API to raylib without automatic freeing (WindowResources) HOT 5
- loadFontEx does not appear to work HOT 5
- `5.5.0.0` release checklist
- Missing function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h-raylib.