Comments (3)
To use card prerequisites, you would populate the prerequisites
list in a Card
instance. Each entry is an ICardPrerequisite
, and has a Status
property, which describes, as a bit field, what has to have happened to some other card, in order for the card holding the prerequisite to be shown.
In your example case:
Suppose we have some Card a
whose id
in storage is 6, and some Card b
whose id
is 9. We only want a
to be shown to the player if the player has swiped b
to the left before.
a.prerequisites
will therefore contain at least one item, perhaps constructed like so:
CardPrerequisite p = new CardPrerequisite();
p.id = 9;
p.status = CardStatus.LeftActionTaken;
(I didn't create a special constructor for CardPrerequisite
and SpecialCardPrerequisite
because they were usually imported from Google Sheets)
Prerequisites are checked during loading of player's progress. Then, whenever a card is shown or swiped, each of its dependent cards is checked, and added to the pool of drawable cards if its prerequisites are now satisfied.
from deckswipe.
Thank you again, your answer is exactly what i was trying to understand...
Also is there a way to show a card only once?
from deckswipe.
No, there isn't. Once a card is added to drawable ones, it's never removed. That is something you would have to implement yourself.
If you do, and would like to have it integrated here, I am accepting PRs :)
from deckswipe.
Related Issues (20)
- Ingame date can be advanced without actually playing the game
- Code cleanup HOT 1
- Animate deck drop/shuffle at game start
- Rename stats
- Put current gameplay progress on the game UI
- Create menu screen
- Replace text font HOT 1
- Replace placeholder card sprite
- Separate special cards from regular cards in model
- Change API key supply method
- [GoogleSheetsImporter] Request failed HOT 3
- NullReferenceException in GameProgress.AttachReferences HOT 5
- Problem with GoogleSheetsImporter using Windows HOT 4
- Special letter
- Update README
- Create alternative way to supply card data
- Switch to Unity's new Input System HOT 2
- Visual preview of action outcome HOT 2
- Eliminate need for dummy cards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deckswipe.