backward form because the initial game was affected by the hardware level, the conversion system is one of the most discounted methods. From this point of view, the conversion system is not lagging behind, but it is also a bit elegant and classical. This is why domestic standalone games like to use the conversion mode, we do not envy foreign game masterpiece, we do not envy foreign
Prototype prototype mode is a creation design pattern, prototype mode allows an object to create another customizable object without knowing the details of how to create it, by passing a prototype object to the object to be created, The objects to be created are created by requesting the
(No. 00002) prototype of iOS game genie war (10)
So far, there has been no returning bullets. If the bullets hit the target or fly out of the screen, there is no need for the bullets to exist.
It does not exist here, instead of deleting it from the screen, because the role of the bullet cache is mentioned above, so it is only possible to set it to invisible here.
First, process the bullets on the fly-out
(No. 00002) prototype of iOS game genie war (III)
Create a Sprites folder in Sprite, add the Player. cc file to it, and ensure that the file type is Sprite.
Set the CC sprite's Sprite frame for its Root node to Image/sprite-2.png, open the physical object, adjust the Physics shape type to Circle, and adjust the Circle radius to match the node Image size, set the physical object type to dynamic.
Set the
Author: Flash knife prodigal son www.iflashigame.com http://hi.baidu.com/mr_ziqiangReprinted please indicate the source
Today, when playing games, the game has a simple requirement:
There is a character. When you move the mouse over it, you need to display the hand pointer.If (mouseevent. mouse_over) mouse. cursor = "button ";
However, after a player clicks the attack key, it needs to hide the mouse and replace the mouse with a sight MC. At this
(No. 00002) prototype of iOS game genie war (7)
In the previous post, we continue to complete the shooting function.
Add the initBullets method in MainScene. m:
-(void)initBullets{ CCSprite *bullet; for (int i = 0; i
This method is used to cache bullets in advance. The value of MAX_BULLET_COUNT is 10, which indicates that we have created 10 bullets in advance. These 10 bullets can be reused, resultin
(No. 00002) prototype of iOS game genie war (9)
Open MainScene. m and add the shoot method:
// The speed of a bullet is now related to the target distance. The closer the bullet speed is, the slower the bullet speed is. it should be changed to a constant speed. -(void) shoot :( CCNode *) player target :( CGPoint) point {CGPoint velocity = ccpSub (point, player. position); velocity = ccpMult (velocity, 50);
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.