jakubg1 / OpenSMCE

Game engine which allows creating a broad range of marble popper games.
MIT License
14 stars 11 forks source link

Add ability for mods to provide custom aiming reticals #75

Closed ShamblesSM closed 2 years ago

ShamblesSM commented 2 years ago

For now it only supports normal spheres. I would love to support radius spheres, but I do not have enough Math knowledge to do so.

This is a new addition to config/gameplay.json:

    "shooter": {
        "...": "..."
        "reticleSprite": "sprites/game/reticle.json",
        "reticleOffset": { "x": 0, "y": 0 },
        "reticleNextBallSprite": "sprites/game/reticle_next_ball_s.json",
        "reticleNextBallOffset": { "x": 0, "y": 0 }
    },

reticleSprite: (string) The aiming reticle sprite to use when Aiming Retical is on. Will fallback to the default drawn caret if not defined. reticleOffset: (Vec2) The aiming reticle's offset, relative to the position the cursor is aiming at. reticleNextBallSprite: (string) The aiming reticle's next ball sprite to use when Aiming Retical is on. Will only be drawn if reticleSprite is defined. reticleNextBallOffset: (Vec2) The aiming reticle's offset, relative to the top-left of the aiming retical.

Here's an example:

    "reticleSprite": "sprites/game/reticle.json",
    "reticleOffset": { "x": 0, "y": 0 },
    "reticleNextBallSprite": "sprites/game/reticle_next_ball_s.json",
    "reticleNextBallOffset": { "x": 8, "y": 15 }

Example of custom reticle

jakubg1 commented 2 years ago

The sprites will be aligned to the middle, rather than to the left horizontally. Congratulations on your first contribution!