z-korp / zkube

Dojo game - Tetris like
https://zkube.vercel.app
MIT License
4 stars 14 forks source link

Refactor GameBoard for a more modular and game-oriented architecture #16

Open Cheelax opened 3 weeks ago

Cheelax commented 3 weeks ago

Description: We need to refactor the GameBoard component to improve its structure, make it more modular, and more suitable for animation. The goal is to have a more maintainable and extensible codebase for our game.

Tasks to accomplish:

  1. Create a centralized game state (GameState)
    • Define a GameState interface that encompasses all aspects of the game's state
    • Include the grid, score, combo, bonuses, etc.
  2. Develop a custom hook for game logic (useGameLogic)
    • Move the majority of the game logic into this hook
    • Implement methods to manipulate the game state (e.g., movePiece, applyGravity, clearLines)
  3. Divide GameBoard into smaller, specialized components
    • Create separate components for ScoreDisplay, BonusPanel, Grid, NextLineDisplay, etc.
    • Ensure each component has a unique and clear responsibility
  4. Integrate an animation system
    • Use React Spring or Framer Motion to handle animations
    • Create animated components for the game's cells and pieces
  5. Separate concerns into distinct files
    • Create separate files for different parts of the game logic (gravity, bonuses, etc.)
    • Organize the code logically and intuitively
  6. Test the new implementation
    • Ensure that all existing functionalities work correctly after refactoring
    • Add new unit tests if necessary

Acceptance Criteria:

Feel free to discuss this refactoring in the comments if you have any questions or additional suggestions.

Iwueseiter commented 3 weeks ago

Hi @Cheelax can I work on this? I’ve gone through the task description and I’m open to work on it. I’d make sure to meet up with the expected criteria. And I will deliver within 3 to 4 working days.

Here is how I would work on the issue: I’d define an interface that encapsulates all game state properties as stated in the description. Then using react, I’d create and manage a centralize state of the game logic. I’d create a custom hook to manage the game state and provide the methods to manipulate the state. I would make sure to break down the code into smaller components that will focus on specific part of the game state and UI making it easier to manage and test. I will integrate an animation system and also implement an event system for the game. I would separate concerns into distinct files for better code organization. Finally, I will carry out unit testing to ensure all functionalities work as expected and I’d write new tests if need arises. And also regression testing to ensure the game behaves as before refactoring.

od-hunter commented 3 weeks ago

Hi @Cheelax , can I be assigned this please?

Jemiiah commented 3 weeks ago

I would love to work on this issue @Cheelax

GoSTEAN commented 3 weeks ago

@Cheelax Can this be assigned to be?

CollinsC1O commented 3 weeks ago

Hi @Cheelax i will love to be assigned this issue. I'm a frontend and blockchain developer and this is the following ways inwhich i could solve this issue:

To refactor the GameBoard component:

Centralize Game State: Define a GameState interface and manage state using context or state management.

Create a Custom Hook: Move game logic to useGameLogic for state manipulation and game rules.

Modularize Components: Break GameBoard into smaller components like ScoreDisplay and Grid.

Add Animations: Use React Spring or Framer Motion for animated game elements.

Implement Event System: Use a game event context for component interactions.

Organize Code: Separate logic into distinct files for clarity.

Test Thoroughly: Ensure functionality and add new tests as do needed.
martinvibes commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i'm a fullstack dev and i have skills in react, typescript, next.js, tailwind, sass, boostrap etc. i would love to work on this i i'm giving the oppotunity

How I plan on tackling this issue

Create Centralized GameState: Define a GameState interface to store all game state data. Develop Game Logic Hook: Move most game logic into a custom hook, useGameLogic. Divide GameBoard: Create smaller components for ScoreDisplay, BonusPanel, Grid, NextLineDisplay, etc. Integrate Animation System: Use React Spring or Framer Motion for animations. Implement Event System: Use a game event context to manage component interactions. Separate Concerns: Create separate files for different parts of the game logic. Test New Implementation: Ensure all functionalities work correctly and add new unit tests.

od-hunter commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi, please I'd love to be given the opportunity to contribute to this rep, I am a blockchain developer html, css, react, JavaScript, typescript, solidity and Cairo. I'd love to be given the opportunity to contribute to this repo

How I plan on tackling this issue

To solve this issue, I'd take the following steps:

  1. I'll create a GameState object and interface to manage all game aspects.
  2. I'll develop a custom hook(implement a useGameLogic hook for key game logic functions.
  3. I'll divide into Components: Break GameBoard into specialized components (e.g., ScoreDisplay, Grid).
  4. Next, I'll integrate Animations: Use React Spring or Framer Motion for smooth animations.
  5. I'll organize code, that is to separate concerns into distinct files for better structure.
  6. Lastly, I'll test thoroughly to ensure the game functions correctly with the new architecture. Please assign this issue to me, I'm ready to work
Iwueseiter commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi @Cheelax can I work on this? I'm a frontend smart contract developer and I've contributed to projects here on onlydust. with this experience, I'd implement the task as expected I’ve gone through the task description and I’m open to work on it. I’d make sure to meet up with the expected criteria. And I will deliver within 3 to 4 working days.

How I plan on tackling this issue

Here is how I would work on the issue: I’d define an interface that encapsulates all game state properties as stated in the description. Then using react, I’d create and manage a centralize state of the game logic. I’d create a custom hook to manage the game state and provide the methods to manipulate the state. I would make sure to break down the code into smaller components that will focus on specific part of the game state and UI making it easier to manage and test. I will integrate an animation system and also implement an event system for the game. I would separate concerns into distinct files for better code organization. Finally, I will carry out unit testing to ensure all functionalities work as expected and I’d write new tests if need arises. And also regression testing to ensure the game behaves as before refactoring.

martinvibes commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i'm a fullstack dev and i have skills in react, typescript, next.js, tailwind, sass, boostrap etc. i would love to work on this i i'm giving the oppotunity

How I plan on tackling this issue

Create Centralized GameState: Define a GameState interface to store all game state data. Develop Game Logic Hook: Move most game logic into a custom hook, useGameLogic. Divide GameBoard: Create smaller components for ScoreDisplay, BonusPanel, Grid, NextLineDisplay, etc. Integrate Animation System: Use React Spring or Framer Motion for animations. Implement Event System: Use a game event context to manage component interactions. Separate Concerns: Create separate files for different parts of the game logic. Test New Implementation: Ensure all functionalities work correctly and add new unit tests.

Benjtalkshow commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hi @Cheelax

I’m available to take on the task of refactoring the GameBoard component to enhance its structure, modularity, and suitability for animation. My name is Benjamin, and I have extensive experience with TypeScript and frontend development, including refactoring and optimizing complex UI components.

Understanding the Issue

The current GameBoard component is monolithic and challenging to maintain, especially as the game logic and UI grow more complex. Refactoring the component will improve the codebase’s structure, making it more modular and easier to extend, and will facilitate smooth animations.

How I plan on tackling this issue

Create a Centralized Game State (GameState)

Develop a Custom Hook for Game Logic (useGameLogic)

Divide GameBoard into Smaller, Specialized Components

Integrate an Animation System

Implement an Event System for the Game

Separate Concerns into Distinct Files

Test the New Implementation

josephchimebuka commented 3 weeks ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @Cheelax I am Joseph Chimebuka I'm a full-stack software developer with 4+ years of experience in crafting innovative products. I've built a range of projects, including https://mattedsgn.vercel.app/ and https://metacrypt.vercel.app/ showcasing my expertise in React, Next.js, and blockchain technologies. I'm also an active contributor onlydust. here's my account https://app.onlydust.com/u/josephchimebuka.

How I plan on tackling this issue

I will ensure that the acceptable criteria for submission has been met before sending a pull PR and I will send it ASAP

Cheelax commented 3 weeks ago

Hi everyone. There is a new process for the ODHack, now you must apply to the tasks directly from Onlydust: https://app.onlydust.com/hackathons/odhack-70 We will only look at application made via this process.

onlydustapp[bot] commented 3 weeks ago

The maintainer Cheelax has assigned od-hunter to this issue via OnlyDust Platform. Good luck!

Dprof-in-tech commented 1 day ago

Hello @Cheelax , please i would love to work on this issue

onlydustapp[bot] commented 1 day ago

Hey @Dprof-in-tech! Thanks for showing interest. We've created an application for you to contribute to zKube. Go check it out on OnlyDust!

Iwueseiter commented 1 day ago

Hi @Cheelax

Hi @Cheelax can I work on this? I’ve gone through the task description and I’m open to work on it. I’d make sure to meet up with the expected criteria. And I will deliver within 3 to 4 working days.

Here is how I would work on the issue: I’d define an interface that encapsulates all game state properties as stated in the description. Then using react, I’d create and manage a centralize state of the game logic. I’d create a custom hook to manage the game state and provide the methods to manipulate the state. I would make sure to break down the code into smaller components that will focus on specific part of the game state and UI making it easier to manage and test. I will integrate an animation system and also implement an event system for the game. I would separate concerns into distinct files for better code organization. Finally, I will carry out unit testing to ensure all functionalities work as expected and I’d write new tests if need arises. And also regression testing to ensure the game behaves as before refactoring.

Hi @Cheelax can I work on this?