Giter Club home page Giter Club logo

sym_merged's People

Contributors

copyrat90 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

Watchers

 avatar  avatar  avatar

sym_merged's Issues

Things to fix

Things to fix

Code

  • Change AllocateGraphic(...) so that it also requires camera as an argument and deal with the camera automatically.
  • Change inline constexpr constants to extern const, and move them from header to TU

Scene

  • Add scene::StageSelect

scene::Game

  • Fix entities at times not aligning properly by 1 pixel to the tilemap
  • Add Back to stage select on pause menu

Transition

  • Fix spike transition crash when zone transition is already taking place

Mechanics

  • Reset button press & symbol pickup/drop on midair when hit by spikes
  • Add moving platform
  • Add touch-fading platform

Player

  • Fix holding B takes too long to merge/split the symbol(s).
  • Fix player collision (which is only 1 bn::fixed_rect right now, need to make more rects)
  • Fix 2 tiles (mostly 2 corner tiles) collision not done properly, resulting in clipping into a wall
  • Fix player not turn around to heading direction when falling

Level design

  • #3
  • Add more tutorial-like levels to showcase how the mechanics work

W1_S2_Z3

Build Issue

C:/butano/homebrew/sym_merged/src/game_system_PhysicsMovement.cpp: In function 'bn::optional<sym::game::system::{anonymous}::PushbackDirection> sym::game::system::{anonymous}::PlatformCollisionResolution_(sym::game::entity::IPhysicsEntity&, const sym::helper::tilemap::TileInfo&)':
C:/butano/homebrew/sym_merged/src/game_system_PhysicsMovement.cpp:97:90: error: 'const class bn::fixed_rect' has no member named 'top_right'
   97 |     const TileInfo::Flags topRightTileFlag = mapTileInfo.GetTileFlagsByPosition(collider.top_right());
      |
                    ^~~~~~~~~
C:/butano/homebrew/sym_merged/src/game_system_PhysicsMovement.cpp:98:92: error: 'const class bn::fixed_rect' has no member named 'bottom_left'; did you mean 'top_left'?
   98 |     const TileInfo::Flags bottomLeftTileFlag = mapTileInfo.GetTileFlagsByPosition(collider.bottom_left());
      |
                      ^~~~~~~~~~~
      |
                      top_left
C:/butano/homebrew/sym_merged/src/game_system_PhysicsMovement.cpp: In member 
function 'void sym::game::system::PhysicsMovement::SymbolCollision_(sym::game::entity::Symbol&)':
C:/butano/homebrew/sym_merged/src/game_system_PhysicsMovement.cpp:569:32: error: 'struct sym::scene::GameState' has no member named 'fadeIn'
  569 |                     if (state_.fadeIn.GetState() != effect::Transition::State::ONGOING)
      |                                ^~~~~~
make[1]: *** [/opt/devkitpro/devkitARM/base_rules:80: game_system_PhysicsMovement.o] Error 1
make: *** [/c/butano/butano/butano.mak:156: build] Error 2

For some reason I get this error.

Add level generator script (Codegen!)

a = World number
b = Stage number
c = Zone number
n = image number (single image can contain multiple zones)

Implement stage-codegen.py

  • Generate game_stage_Wa_Sb.cpp
    • Learn to parse *.tmx file, which is basically *.xml file
    • Restructure bg_wa_sb_n.tmx file(s), so that the zone boundaries can be identified with the zone number.
      • Change Tiled layers so that each zone takes each Tiled layers
      • Find the first non-zero cell from the front and back on each zone, to find top-left and bottom-right cell
      • (Optional) Fix the helper::tilemap::IndexRect ctor, so that it can take top-left and bottom-right cell
      • (Optional) Add object template to Tiled object layer
    • Parse bg_wa_sb_n.tmx file(s) and generate game_stage_Wa_Sb.cpp
      • When there is no certain entity available on zone c, generate constexpr bn::span<ZoneInfo::{EntityInfo}> Zc_{entityInfo}s_ instead of constexpr ZoneInfo::{EntityInfo} Zc_{entityInfo}s_[]
  • Overwrite game_stage_getter.h to currently existing stages

Optional things

  • Rebuild a stage only when it is edited
    • Compare the modified time of generated zone header and the *.tmx file(s) of the zone
      • os.path.getmtime() considered helpful
  • Verify if the stage is valid
    • Check if there is at least one entrance on Z0_entranceInfos_ (index 0 of it is where the stage starts)
    • Check if it has only one black hole (stage clear)
    • Check if every Zc_exitInfos_ is connected to a valid zone number and a valid entrance index of that zone
    • Check if every size of the zone is same or bigger than (30, 20) cells
    • Check if unsupported items present (or simply ignore that one?)
    • Warn unused entrance (exception: Z0_Ent0, where the stage starts)
  • Optimize codegen by generating each game_stage_Wa_Sb.cpp asynchronously.

[โš ๏ธ Warning] Beware of super messy code!

It looks like this repo got quite a lot of stars, thanks everyone!
But I need to mention that it is quite messy and very far from optimal, so beware of the messy code.

  • This uses affine_bg to get unique cell id, but now there's better way to do this with Butano. Check the dynamic_regular_bg example and this demo I made
  • I didn't know how to structure my code the time I was working on this one. Like, it's full of if~else checks, updating game variables from everywhere etc. If I decide to make this a full game someday, I have to rewrite it from scratch at this point.

Originally posted by @copyrat90 in #4

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.