Advertisement

How to structure the program design of card effects for a Trading Card Game in Java?

Started by June 26, 2021 09:23 PM
11 comments, last by smashhit 3 years, 5 months ago

the most easy way is you take the Canvas of the Image/Sprite and save the original Bitmap thing (for restore at end of FX process) and then operate with that Canvas and some functions of “draw” for make things like some star-spots (example of FX) and then at end of FX restore the saved Bitmap state for view normal Card .

NOTE that this works at the inside region of the whole card Sprite….if you want for example the FX makes over and outside the card you could have to use another Sprite/Image onto the card for make realize the FX

I'm thinking of creating a method that assigns a card its effect when it's played based on the card's name, but that doesn't really work when a card's effect isn't supposed to be activated when it's played, like in the case of Deathrattle cards, or when it's a continuous effect. I've thought of creating a thread for each effect which activates it whenever needed, but... that's a LOT of unique threads. I haven't found any similar java programs anywhere, so I wanna ask here. How do you think card effects should be handled?


This topic is closed to new replies.

Advertisement