SPUDevelopers / Naturalize

A Cocos2d-x turn based strategy game.
Other
11 stars 7 forks source link

Add movable cursor #9

Open Isaac-W opened 9 years ago

Isaac-W commented 9 years ago

Implement class; it should contain the position of the cursor, on-screen drawing details, etc.

The cursor class should also have methods to handle moving of the cursor, like moveToXY(). These methods will be called by the main game scene.

Open Tasks:

Isaac-W commented 9 years ago

Assigned to @sanderzinc to cooperate with @DocDerwin in implementing this.

aarongrider commented 9 years ago

Isaac committed some boiler plate classes to get you guys started with this.

Isaac-W commented 9 years ago

The Cursor class also needs to subclass/inherit from cocos2d::Node, as it is also a visible element on the screen. See issue #8 for more details regarding Nodes.

I think that it would be a good idea if @sanderzinc posts any relevant details regarding the implementation of the Cursor class, and then @DocDerwin can work on coding it up.

Isaac-W commented 9 years ago

I have added some additional tasks to the original issue.

DocDerwin commented 9 years ago

Awesome. Trenton and I will get on it.

Sent from my Windows Phone


From: Isaac Wangmailto:notifications@github.com Sent: ‎12/‎16/‎2014 6:26 PM To: SPUDevelopers/Naturalizemailto:Naturalize@noreply.github.com Cc: Doc Derwinmailto:docderwin@hotmail.com Subject: Re: [Naturalize] Add movable cursor (#9)

I have added some additional tasks to the original issue.


Reply to this email directly or view it on GitHub: https://github.com/SPUDevelopers/Naturalize/issues/9#issuecomment-67268477

aarongrider commented 9 years ago

One thing I just noticed is that the cursor init function is written in the header file. Normally, this is not a good place to put it. We should be declaring the init function in the header and defining it in the .cpp. See the other classes for more info. Would you mind making those changes for your next pull request?

Isaac-W commented 9 years ago

Because the Cursor inherits from Node, it has its own internal position. We don't actually need to create two instance variables for the xy coordinates. However, the methods stay the same, because we want the game to use the cursor in terms of map tiles, not internal coordinates.

The Cursor class should be updated to use the internal Node (this->setPosition() & this->getPosition()) methods instead of keeping track of it ourselves.