Giter Club home page Giter Club logo

konkan's Issues

App Icon

Find a neat design for the icon of the app.

Players can exchange cards

Since the app used to be solitaire and each player used to be a column, the last cards (or cards that are in order e.g. 4,5,6,7) can be added from one column to the other if the other column matches.

Example:

Column1 Column2
4 5

Then after moving 4 from column1 to column5

Column1 Column2
5,4

Players nowhere in the actual game are allowed to directly exchange cards.

Modify PlayingCard Model

This issue is focused on optimizing the PlayingCard model by inserting most of the scattered functionality into the model.

Navigation and routing

We will need to establish a way to manage the flow of the app's pages.
For example, when the app starts it should first go to a splash screen then check if a user is logged in. If so, the user is sent to a home screen. If not he it should go to the login-screen. And so forth.

Create player turns

Currently all players can play out of turn (anyone can discard cards). Konkan can either play clockwise or anti-clockwise.

Player Row Bug

The bug persists on the devel branch.

bug

Console log:

Launching lib\main.dart on sdk gphone x86 in debug mode... Running Gradle task 'assembleDebug'... √ Built build\app\outputs\apk\debug\app-debug.apk. Debug service listening on ws://127.0.0.1:50972/Ma49F9R-h8M=/ws Syncing files to device sdk gphone x86... I/Choreographer( 2946): Skipped 222 frames! The application may be doing too much work on its main thread. I/flutter ( 2946): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter ( 2946): The following assertion was thrown during layout: I/flutter ( 2946): A RenderFlex overflowed by 33 pixels on the bottom. I/flutter ( 2946): I/flutter ( 2946): The relevant error-causing widget was: I/flutter ( 2946): Column file:///C:/Users/Pyromaniac/Desktop/Konkan/lib/pages/game_screen.dart:84:13 I/flutter ( 2946): I/flutter ( 2946): The overflowing RenderFlex has an orientation of Axis.vertical. I/flutter ( 2946): The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and I/flutter ( 2946): black striped pattern. This is usually caused by the contents being too big for the RenderFlex. I/flutter ( 2946): Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the I/flutter ( 2946): RenderFlex to fit within the available space instead of being sized to their natural size. I/flutter ( 2946): This is considered an error condition because it indicates that there is content that cannot be I/flutter ( 2946): seen. If the content is legitimately bigger than the available space, consider clipping it with a I/flutter ( 2946): ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, I/flutter ( 2946): like a ListView. I/flutter ( 2946): The specific RenderFlex in question is: RenderFlex#d13d9 relayoutBoundary=up1 OVERFLOWING: I/flutter ( 2946): needs compositing I/flutter ( 2946): creator: Column ← _BodyBuilder ← MediaQuery ← LayoutId-[<_ScaffoldSlot.body>] ← I/flutter ( 2946): CustomMultiChildLayout ← AnimatedBuilder ← DefaultTextStyle ← AnimatedDefaultTextStyle ← I/flutter ( 2946): _InkFeatures-[GlobalKey#4eeac ink renderer] ← NotificationListener<LayoutChangedNotification> ← I/flutter ( 2946): PhysicalModel ← AnimatedPhysicalModel ← ⋯ I/flutter ( 2946): parentData: offset=Offset(0.0, 80.0); id=_ScaffoldSlot.body (can use size) I/flutter ( 2946): constraints: BoxConstraints(0.0<=w<=411.4, 0.0<=h<=603.4) I/flutter ( 2946): size: Size(411.4, 603.4) I/flutter ( 2946): direction: vertical I/flutter ( 2946): mainAxisAlignment: spaceAround I/flutter ( 2946): mainAxisSize: max I/flutter ( 2946): crossAxisAlignment: center I/flutter ( 2946): verticalDirection: down I/flutter ( 2946): ◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤ I/flutter ( 2946): ════════════════════════════════════════════════════════════════════════════════════════════════════

Create AI to replace players

This is created to be able to complete #21. AI does not need to be smart at all (i.e. just throws a card at random in its turn). This issue must be finished before #21.

Joker doesn't meld

When a joker is dropped on a group a playing card is returned instead of null.

image

dropping JKR on (K♢, Q♢, J♢, 10♢, 9♢, 8♢)
{0: Instance of 'PlayingCard', 1: Instance of 'PlayingCard'}
(K♢, Q♢, J♢, 10♢, 9♢, 8♢) return Instance of 'PlayingCard'

Add game animations

Some ideas (We don't need to stick to these ideas):

  1. Card shuffling
  2. Smooth transitioning between game states
  3. Smooth transitions when viewing other players information
  4. etc...

Make DROPPED deck look better

DROPPED deck is draggable once there are cards. However, when dragged, cards in the bottom of the deck disappear.

Create a game state class

A game state class must be created to make online games with multiple players possible.

The game state class must have enough information for the game to function properly, but not too much information for someone to hack the game using the gamestate, but that can ignored if it's too difficult.

Game state must have these:

  1. Cards to draw
  2. Cards discarded by previous players
  3. Player information:
    a. how many cards they have left
    b. whose turn is it
    c. who's next
  4. Score to set cards
  5. Set cards

Game UI

UI that would reflect the following:

  1. Game state
  2. Player Cards
  3. Show that game is over
  4. Other players state

Code up setting cards given conditions

Currently on b9c4e81 players are not able to set their cards in the code. However, players do have a set cards deck in the Player.dart file List<PlayingCard> openCards
The purpose of this issue is the following:

  1. Given its a player's turn in game_screen.dart:
    a. allow player to set his cards if the conditions from the rules on the README.md in master branch are fulfilled
    b. If a player set his cards, move cards from player.cards to player.openCards.
    c. a player must have at least 1 card left in his player.cards deck
  2. After a player set his cards, the score threshold to set cards must be modified.

After 1b, hopefully the visualization will reflect the change.

Card design

Cards must have a more radiant design (better look, light shadow, animation,...etc)

Multiple Pages to navigate within app

App currently has a single page (game page).
At the very least there should be:

  1. settings page
  2. home screen page
  3. game page

and optionally login page

Animating page navigation

Animations between pages and navigations.

Users should be able to toggle animations in the settings

Make each player have control over their individual cards

Currently players can only drag cards in a solitaire fashion (if a card has cards over it, you must drag them too). In konkan you must be able to both:

  1. Shuffle your cards in your hand individually

    This can be resolved by either using swapping between cards, or having a scratch space to drop cards in

  2. Be able to pick individual cards to discard them

Connect grouping to UI

Grouping is now achieved through the validate function in models/groups.dart.
It returns a list of Meld objects of the possible outcomes, arranged by penalty value.
In the case of no possible outcomes, the function returns an empty list.

File structure

There are multiple files in the software which can be clustered based on function

Setting cards code is running, grouping cards is not

Currently in e8e83fa given a grouping (e.g. List<List>) a score is generated and moved to set cards if conditions are acceptable. However, the grouping has not been generated by the logic.

There are many ways this can be solved:

  • Grouping based on cards and maximizing the score without the player himself having to pick the grouping. This would have the following characteristics:
  1. Low Speed
  2. Takes away choosing the grouping by players
  3. Would require a lot of testing to make sure it works 100% of the time since when it doesn't work perfectly it can be catastrophic
  • Grouping based on what the player selects (which I think is preferable) which means the following is necessary:
  1. The selection must be clear enough for us to only have to check if each grouping does not violate the game
  2. The UI must be helpful enough to make selection easy
  3. The UI must be flexible enough to have different grouping variations (e.g. some groups can have 3 cards, some can have 5 some can have 8...etc)

Create a Facade pattern for the game

The game currently has a lot of code scattered around game_screen.dart that handles the game logic using multiple explicit calls.

Ideally this is how the game needs to cycle using very few calls:

GameState.initializeGame()

currentPlayer = GameState.initializeTurns(Players)

while (gameNotOver):

          GameState = currentPlayer.play(GameState)
          if (GameState.checkWin()):
                   gameNotOver = false
                   break
         currentPlayer = GameState.nextPlayer(currentPlayer)

GameState.trackStats()

Create game server

The server must be able to communicate the following with the app:

  1. Game state
  2. Players info
  3. Players turns

and optionally we can track data usage of players

Refactor widgets

Widgets in game screen have a lot of redundant information, so it needs to be refactored to be more clear and concise.

Game logic

This consists of:

  1. Getting actual (or simulated) game state information from the server
  2. incorporating information of the game state to know which moves are possible
  3. Sending actual (or simulated) game state information to the server after a player's turn is complete
  4. Sending game termination signal if the game is over

None of this has to be in the UI (UI can be dealt with in a separate issue)

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.