Project: Small memory card game – how to get from python console to actual game with clickable objects?
- Document object model also may be the solution:https://www.w3schools.com/js/js_htmldom.asp
I’ll go into these topics now, maybe I can find a solution
Now I start a second attempt with this. If you know how to code this or you can help me, I would really appreciate it if you would be my mentor or if you could help me with this project. If you don’t know how to code very well but you are interested in this project, I would also like to collaborate as a team on this.
TL;dr: The game is bascically memory, but you can steal each others cards and you have to throw a dice to find a specific card, so there are no pairs. --> at the bottom i described the specific rules of the game, if you are interested.
Now I want to describe my problem:
I coded this game probably very innefficient, but the logic of the game works. The “front end” of the game is really my problem though + how it would work together with the “back end”/logic of the game.
what I tried is:
- Coded the game in python as a console game
- Coded a DIV container, in which are the players cards, the cards in the middle and the cards of player 2
- inserted jpg of the back of the card.
What I need is:
- How do I now bascially make objects/ the cards
1.1 Make this card turn if I click on it
1.2 Make this card go to player 1 deck, if he clicks the right card
1.3 Make the card “a card”, meaning the cards can change, you would click on a position on the board and the corresponding card would be relevant.
Because of this, I stopped working on it a few months back. Now i want to tackle it again, cause I have more time again. Please help me, I’m completely stuck in this project.
Here is the working python code I have now: Github - Python Code
"Mock up" HTML version, how it should look like: Github - HTML Code
(rules of the game – if you’re interested)
there are 4 forms, and 4 colors. The beginning player begins by throwing 2 dice, 1 for the color and 1 for the form. Then, he needs to find the equivalent card to this dice combination on the board. The Board consists out of 16 cards, which are turned, so you don’t know which card is which. Now you can pick the card as in a memory game. if it’s the correct card, you lay it on to your side. If its the wrong, it goes back to the position on the board, as in a memory game. Now It’s player 2’s turn. He throws the dice, and searches for the equivalent card again. He can also steal player 1’s card. The game is over, if all cards in the middle are picked.
There are a few additional rules like bad cards where you get negativ points, and in some die throws you can pick any color/form, but it’s not relevant to the problem I’m having, so I don’t want to confuse you or steal your time.