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 8560331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:15:08+00:00 2026-06-11T16:15:08+00:00

I have got a game layer and a child node (CCNode) called TestNode.I added

  • 0

I have got a game layer and a child node (CCNode) called TestNode.I added a spritesheet to TestNode and several “missiles” to this spritesheet. Now my problem is the collision detection of those missiles with objects in the game layer, because coordinates seem to be f’d up.

I have got the following in the missile implementation:

//first I get the Game layer
GameLayer *gL = (GameLayer *)self.parent.parent.parent; 
//parent = spritesheet, spritesheet's parent = TestNode, TestNode's parent = Game layer

//Now I convert the coordinates of missile to Game Layer's node space
CGPoint realPos = [gL convertToNodeSpace:self.position];

This is roughly what I do in my code… and it does not seem to be working! I do pretty much the same collision detection with the TestNode and it seems to be working perfectly fine. Is it because of the spritesheet ? I have been struggling a couple of days now, but I can’t get it working at all. Changes give me hardly any hints what I am doing wrong. So you are pretty much my last hope…

  • 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-06-11T16:15:09+00:00Added an answer on June 11, 2026 at 4:15 pm

    You want to convert the missile position to world space:

    CGPoint realPos = [self convertToWorldSpace:position];
    

    If it’s still not correct, maybe you changed the anchorPoint? In that case the visual part (the texture) will simply be offset from the position and may seem to be incorrect just by looking at it.

    As for self.parent.parent.parent and so on … you should read the latter part of this answer. It’s not good practice because it’s a fragile construct which can easily break when you change the node hierarchy.

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

Sidebar

Related Questions

I am making a game, I have got several different classes as I dont
I am creating a copy of the game Pig. I have got a text
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I have got two pages. example.com/php.com and example.com. I use this function to set
I have got quite strange error in my OpenGL game. I would like to
I have been developing a new online game for the past year now. The
I've got a problem. I have my own browser game, and there is something
I have an object named game which has a property called channels (which is
I have got some problem implementing bullet physics into my opengl game. The thing
I have written some code to start off my game, i now want to

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.