Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:26:47+00:00 2026-05-31T05:26:47+00:00

Think card game … Computer attacks human with a card. In response, player moves

  • 0

Think card game …

Computer attacks human with a card. In response, player moves the card on the View to beat it.

In this scenario please confirm that:

(1) It is ok for View to know, where on screen “landing area is” without asking it’s controller

(2) It is ok for View to know where the “defender” card on screen is without asking it’s controller

If the view is aware of who both the attacker and defender is, (3) is it ok for a View to determine whether attacker can beat the defender?

If this is not ok, (4) is it ok for a View to class other then it’s controller for this information (think Utils class), or should it always be the controller?

(5) Would it be better instead to send a delegate method to the controller indicating that “attacker card landed on defender card” and expect boolean whether attack will succeed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:26:48+00:00Added an answer on May 31, 2026 at 5:26 am

    The view is a passive input/output device. It should not know anything about the gameplay rules, like whether the attacker can beat the defender. Even the controller should not know the gameplay rules, the model always decides that.

    The view should be able to represent and handle all possible input and output states and relay the input to the controller. The controller will pass the input information to model and update the view according to new model state. In your case the view detects that card A landed on card B and passes the information to the controller. The controller passes the information to the model, the model transitions to a new game state and the controller will update the view to the new state. Sometimes the view can update automatically by observing the model directly, it depends on the situation.

    A good way to think about the MVC separation rules is to imagine porting the game to a different interface (GUI/CLI) or a different skin. If you find that you would have to redo a substantial part of the code to support a different interface, that you would have to touch something besides the interface-specific stuff, that means the design is not optimal.

    Another good source of design intuition is testing & simulation. If want to run some automatic tests or game simulations, you are forced to keep the game code separate from the input and output inside the model. When the logic is sprinkled over the whole MVC, testing and simulating the game hurts and reminds you that something is wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a card game. In the start of the game each player
I have the following scenario: I'm creating a card game, and as part of
In a simple card game (human vs. CPU) the logic works, but I want
Think: tiling my emacs window with eshells, a la xmonad. Is this possible? I
I think know how to do this in C# but I'm having syntax trouble
I think I already know the answer to this but thought I would ask
A friend and I are creating a card game for the iPhone, and in
I am running into some problems right now. I am developing a card game
I'm trying to develop a card game with Flex, and I was wondering if
I have a Rails app representing a card game. There are several different types

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.