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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:51:11+00:00 2026-06-19T00:51:11+00:00

I am trying to find out frameworks for objective-c that supports entity-component pattern. I

  • 0

I am trying to find out frameworks for objective-c that supports entity-component pattern. I looked about Cocos2d, Kobold2d, KoboldTouch.. but none of them seems related to that. Can anyone please guide me if there is any available framework for objective-c ?

  • 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-19T00:51:12+00:00Added an answer on June 19, 2026 at 12:51 am

    You can manually add the entity-component pattern to cocos2d/etc, though it’s not directly built into the API.

    1. Use -addChild: (et al) in the Entity to add Components.
    2. Use -parent in a Component to access its Entity.
    3. Use -update: in a Component to update its Entity.

    SomeCCNodeEntity.m

    - (id)init {
        if (self = [super init])
        {
            [self addChild:[MoveComponent node]];
        }
        return self;
    }
    

    MoveComponent.m

    CGPoint velocity;
    
    - (id)init {
        if (self = [super init])
        {
            velocity = CGPointMake(0, -50);
            [self scheduleUpdate];
        }
        return self;
    }
    
    - (void)update:(ccTime)delta {
        [[self parent] setPosition:ccpAdd([[self parent] position], ccpMult(velocity, delta))];
    }
    

    The above code moves the Entity whenever the Component’s -update: method is called. This is covered a bit on Learn-Cocos2d: Prefer Composition over Inheritance

    As for a messaging system between different Entities, you’d also have to roll your own. Apple’s API’s have used the idea of delegates, notifications, and observers to tell other objects stuff. Only one object can be a delegate, to perform an optional or required task for another. Multiple objects can register for notifications, or become observers.

    This can get complex quick, especially if, say, you have 10 objects registered as observers, and the order which they receive observation messages is important. Should they get messages based on order they registered in, like FIFO or LIFO? Something more complex? Etc…

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

Sidebar

Related Questions

I'm trying to find out if there are any libraries or frameworks that will
I am trying to find out how to write an SQL statement that will
I'm trying to find out a little bit more about how the preprocessor works
I am just trying to find out that does puppet have something similar to
Trying to find out if it's possible to use SQLAlchemy on Heroku. Thanks.
I trying to find out the visibility of the Excel and do some activities
i m trying to find out how to convert timestamp date and time (
I am trying to find out a way to set a time tag to
I am trying to find out if an instance of an application (not vb.net)
I'm trying to find out how to change the icon of a JStree node

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.