Giter Club home page Giter Club logo

fusion's People

Contributors

dimkauzh avatar dvenru avatar jamim avatar nmsderp avatar techsplosion avatar xcarcedo avatar zenthm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fusion's Issues

Entity images don't work

The Entity.image(window, image_path, x, y, width, height) method is supposed to render an image for the entity, but in the method, instead of the image argument using image_path in the open_image method, it uses image, which causes an error when running the Entity.image method.

Entity gravity throws TypeException

Since PyMunk's gravity takes in a vector and not a number, and the gravity given by the Entity class is a number, it throws this exception:

Traceback (most recent call last):
  File "E:\FusionEngine\bug-hunting\entities.py", line 12, in <module>
    @main.window.loop
     ^^^^^^^^^^^^^^^^
  File "C:\Users\Kivanc64bit\AppData\Local\Programs\Python\Python311\Lib\site-packages\fusionengine\files\window.py", line 58, in loop
    your_loop()
  File "E:\FusionEngine\bug-hunting\entities.py", line 15, in loop
    entity.set_gravity(10)
  File "C:\Users\Kivanc64bit\AppData\Local\Programs\Python\Python311\Lib\site-packages\fusionengine\files\body.py", line 89, in set_gravity
    self.body.space.gravity = self.gravity
    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kivanc64bit\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymunk\space.py", line 230, in _set_gravity
    assert len(gravity_vector) == 2
           ^^^^^^^^^^^^^^^^^^^
TypeError: object of type 'int' has no len()

This can easily be fixed by replacing line 89 (self.body.space.gravity = self.gravity) with self.body.space.gravity = 0, -self.gravity or self.body.space.gravity = -self.gravity, 0 depending on where the vertical component of the vector is located (basically which number is the y axis, it's probably the second value). The negative sign basically inverts the direction to down instead of up, and maybe these constants could be used:

MERCURY = 3.7
EARTH = 9.807
MOON = 1.62
MARS = 3.71
JUPITER = 24.79
SATURN = 10.44
URANUS = 8.87
NEPTUNE = 11.15
PLUTO = 0.62
ERIS = 0.82
HAUMEA = 0.401
MAKEMAKE = 0.5

All are from Google searches of these planets, dwarf planets and moons' gravities.

I know that the physics engine isn't done yet, and I'm trying to help by reporting bugs and offering potential solutions to these bugs.

PR and Issue Templates

This project should have PR and Issue templates for the following reasons:

  • Consistency: Templates ensure that all PRs and issues follow a standardized structure and format.
  • Clear Information: Templates prompt contributors to provide specific details about the PR or issue they are submitting.
  • Guidance for Contributors: Templates can serve as guidance for contributors who might be new to the project or inexperienced with the submission process.
  • Enhanced Project Management: By using templates, the project maintains a higher level of organization.

RGBA Alpha doesn't work properly - bug

This code inside the loop below:

main.draw.draw_rect(window, 0, 0, 100, 100, (0x02, 0x8a, 0xf2, 0xff))
main.draw.draw_rect(window, 50, 50, 100, 100, (0x4a, 0xf2, 0x02, 0x7f))

Should produce this, but instead, the green square is treated as if it is fully opaque (alpha = 255) and produces this, which is not correct.

Ruff implementation

Description

The project has a poor CI (Continuous Integration) at the time, and this issue is dedicated for adding a simple CI for linting the project and formatting with Ruff. This tool is a new absurdly fast all-in-one tool for linting and formatting, which means we don't need to set up other tools (e.g., isort, black, flake8, etc.)

Redundant files and debugfiles directories

The src/fusionengine/files and src/fusionengine/debugfiles directories are redundant and absurd, the contents of these directories should be placed in the src/fusionengine directory.

The src/fusionengine/debugfiles/fe.png file can be src/fusionengine/icon.png.

Fusion Engine 4.2 gives error upon key press detection

The bug is an error with Fusion Engine:

Traceback (most recent call last):
  File "D:\Dot\game.py", line 191, in <module>
    movement_check()
  File "D:\Dot\game.py", line 12, in movement_check
    if engine.Key.key_down(engine.KEY_w) or engine.Key.key_down(engine.KEY_UP):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kivanc64bit\AppData\Roaming\Python\Python312\site-packages\fusionengine\events\event.py", line 13, in key_down
    return keys[self.key]
                ^^^^^^^^
AttributeError: 'int' object has no attribute 'key'

You need to add a key_down function to the loop.

It should've run, but it didn't.

This is what I expected to see:
expected

Windows 11 (10.0.26016, Win10 build 26016) w/ Fusion Engine 4.2.

Need to make it not possible to close window w/o killing process

This feature is (pretty much) required for my game Dot. The entire game can be skipped via closing the window (which skips to the next level).

I'd prefer a method -something named like window.disable_close()-. It disables the close button like on error popups.

I have considered directly interacting with window.window - although I will have to do some research on PyGame.

For example, the feature request would make enabled_close look like disabled_close.

Textures covered up by transparent textures on top

The bug is that transparent textures render over other textures, despite being transparent.

You need to create two textures, one transparent, and draw the transparent texture over the non-transparent one by calling the transp. texture draw after the non-transp. texture draw. Non-transp. will not render.

The non-transp. texture should render.

I have two screenshots that are important, one showing where no texture is on top of another and another where there is. The texture has solid pixels, but the background is transparent.

This is without the overlap.
This demonstrates the bug. The yellow dot has a transparent background.
This demonstrates how it should look. I did some image editing in order to achieve the picture.

I see this issue in Windows 11 Moment 4 Update.

I witnessed the issue before, though.

Automated testing

This project lacks on automation and is crucial for any software development project. One of the most important automation is testing, there are several reasons why automated testing is necessary:

  • Maintaining Code Quality: Automated tests help ensure that the library functions as expected. They can catch bugs and regressions early on, preventing the introduction of new issues with each code change.

  • Regression Detection: As a library evolves and new features or bug fixes are added, there is a risk of introducing unintended side effects or breaking existing functionality. Automated tests act as a safety net to catch regressions, making it easier to identify and fix issues.

  • Confidence in Refactoring: Automated tests provide confidence when refactoring or optimizing code. Developers can refactor with the assurance that if the tests pass, the changes have not broken existing functionality.

  • Platform and Environment Independence: Python libraries are often used in various environments and platforms. Automated tests ensure that the library behaves consistently across different setups, reducing the likelihood of environment-specific issues.

  • Time and Cost Savings: Although setting up automated tests initially takes some effort, they save time and cost in the long run. Identifying and fixing issues early reduces the time spent debugging and maintaining the library.

  • User Trust and Adoption: A well-tested library inspires trust among users and potential adopters. When users see that a library has a comprehensive test suite, they are more likely to rely on it for their projects.

Textures not clearing properly

The textures do not properly clear, and the previous frame's render can be seen.

Create a program with a moving texture.

The textures should clear.

Expected
expected
Reality
reality
Windows 11 Moment 4 update, observed in previous OS releases.

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.