Changing the view from a model (without going through the mediator)

prettymuchbryce's Avatar

prettymuchbryce

24 Sep, 2011 04:15 AM

Hello. I am new to RobotLegs. I am making a top-down game where the information about an npc is stored in a model. It's X and Y position, current goals, the direction its facing, etc.

My question is this: If I need to re-render it's X and Y position every frame, do I need to go through a mediator to do this? Isn't setting X and Y position a basic method that the view should handle? Then I start to think... what kinds of situations would I even need the mediator for in my game, or if I would even need it at all? The NPCS move by their own accord without direct keyboard/mouse input from the user. I guess I am just confused about the role a mediator would play in a situation like this. All I am doing is updating its X and Y position and possibly changing the frame of it's MovieClip.

  1. 1 Posted by Aaron Hardy on 24 Sep, 2011 04:36 AM

    Aaron Hardy's Avatar

    Hey there. The fact that you thought to ask the question is a good sign. I suggest you read some of Jesse Warden's article: http://jessewarden.com/2011/08/why-robotlegs-for-games.html but more particularly the commentary by John Lindquist and specifically watch the video John links to: http://johnlindquist.com/2010/10/13/patterncraft-mediator-pattern-v...

    I think what John describes in his video is usually the right way to go. Hopefully that helps.

  2. 2 Posted by Aaron Hardy on 24 Sep, 2011 04:37 AM

    Aaron Hardy's Avatar

    By "usually" I mean in the case you're describing...not regular business apps.

  3. Support Staff 3 Posted by Ondina D.F. on 02 Nov, 2011 04:13 PM

    Ondina D.F.'s Avatar

    Feel free to reopen this discussion in case you have more questions or you need further assistance with this issue. Please open new threads for new issues.
    Thank you for posting
    Ondina

  4. Ondina D.F. closed this discussion on 02 Nov, 2011 04:13 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac