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

  • Home
  • SEARCH
  • 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 7027363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:14:14+00:00 2026-05-28T00:14:14+00:00

My code has two Bullet-related classes. Bullet and BulletCache. The BulletCache creates a certain

  • 0

My code has two Bullet-related classes. Bullet and BulletCache. The BulletCache creates a certain number of

I have moved on to just creating a new bullet creating method meant to shoot off the bullets. I used the CCFuncN method but the game is currently throwing NSException errors:

CCAction* action = [CCSequence actions:
            [CCAnimate actionWithAnimation:[profile getAnimation:@"attack" index:currentDir]],
            [CCCallFuncN actionWithTarget:self selector:@selector(shootBulletFrom:)],
        nil];

NSInvalidArgumentException', reason: '-[Player shootBulletFrom:]: unrecognized selector sent to instance 0x703ec70'

edit:

For further help and advice here is the shootBulletFrom method in the BulletCache.

This method is in the BulletCache

-(void) shootBulletFrom:(CGPoint)startPosition velocity:(CGPoint)velocity frameName:(NSString*)frameName 
                                                                    isPlayerBullet:(bool)isPlayerBullet
{
    CCArray* bullets = [batch children];
    CCNode* node = [bullets objectAtIndex:nextInactiveBullet];
    NSAssert([node isKindOfClass:[Bullet class]], @"not a Bullet!");

    Bullet* bullet = (Bullet*)node;
    [bullet shootBulletAt:startPosition velocity:velocity frameName:frameName 
                                                    isPlayerBullet:isPlayerBullet];

    nextInactiveBullet++;
    if (nextInactiveBullet >= [bullets count])
    {
        nextInactiveBullet = 0;
    }
}

I was also recommended to change the [CCCallFuncN] call at the bottom to:

[CCCallFuncN actionWithTarget:self selector:@selector(shootBulletFrom:shotPos velocity:velocity frameName:@"bullet1big.png" isPlayerBullet: YES)],

But then I got the compile Error: Expected ‘:’ before Velocity

  • 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-28T00:14:15+00:00Added an answer on May 28, 2026 at 12:14 am

    You have not mentioned the code for shootBulletFrom, and the error denoted that there is some mistake in the same. May be you have not declared the function in .h file or some other. So if possible mention so.

    You can go through this and this links. They are having good examples for bullet firing apps. Hope that helps you.

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

Sidebar

Related Questions

Hi I work with netbeans. I have written a code which has two classes
I have the following code working with a DataGrid that has two column Column_A
I have the following code which has two fields that are queried. How can
I have a function that, for argument sake, has two lines of code. Line
I have created following layout.which has two relative layouts and one scrollview ,following code
I have this code here that has two arrays. It sorts arr[] , so
In the last two days, ive run across code that has php echo'd variables
I've got two branches of code. 1 has a dialog box that the other
I have heard of desktop applications whose code has been open-sourced, but are there
The Code has two options. Option one starts with 1 dollar and doubles everyday

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.