Jump to content
  • Advertisement
Sign in to follow this  

Use of Signals for card game

This topic is 2233 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm currently working on my own Yu-Gi-Oh! Game (I know, there are a lot of people AND a big company working on it, but it's perfect practice for me) and I think of a "Send Signal"-System everytime a player summons a monster or activates a spell/trap card. Now the problem is how to generate such a signal handler:

  • Shall I use a static class (all variables and methods are static) which tells each card what has been played/activated?
  • Is <csignal> of any use for this?
  • Shall I generate an instance of signal handler and send its reference to each Card (SignalHandler& sig_handler;)?

    Would be happy for any advice from you. LG rumpfi88

Share this post


Link to post
Share on other sites
Advertisement
Those signals are generally used for interprocess communication. That is, if you want to send a message to another different process.

Many games will implement their own event listeners; this model is supported by most modern languages where you can register event listeners, and easily broadcast to all interested listeners.

A simple search for "games message event bus" gives a bunch of useful descriptions of how to implement them, many including source code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!