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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:21:46+00:00 2026-05-16T21:21:46+00:00

My question is as easy as that: What is the best method to create

  • 0

My question is as easy as that:
What is the best method to create character for example in Cocos2D?

Here’s an example:
I want to create an enemy of my “Ninja”. The enemy has a strength of 0.5 and a speed of 50. How would you implement this? A subclass of CCSprite or CCLayer or something completely different?

I tried with NSObject, but that’s not really what I was looking for.

I hope you understand what I mean?

  • 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-16T21:21:47+00:00Added an answer on May 16, 2026 at 9:21 pm

    It’s neither wrong nor right to start with a subclass of either CCSprite or NSObject. Which one will suit you better depends on how you structure your game.

    You could of course subclass CCSprite to create a “Ninja” class and add to your ninja propertys like health, strength and so forth. But if your game features several game characters that use the same set of properties, you might want to create a universal “GameCharacter” subclass of CCSprite in between, which you could then subclass further, adding the properties and methods that are specific to a single character.

    If not all game objects are based on CCSprites for example, then you might want to start with a NSObject subclass and add a CCSprite (or some other cocos class) as a property.

    As for the actions: If you start with a subclass of CCSprite, for example, you could just implement a method die which would instantiate the actionobjects and let self run them. You could then either call die directly or call it from another method of the same class which manages hitpoints and calls die once the hitpoints drop below zero.

    However, I suggest you browse the web for some basic game design tutorials. You’ll have a hard time if you don’t plan things thoroughly right at the start…

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

Sidebar

Related Questions

First thing i want to say that it's not an easy question to explain,
I am sure this is an easy question, but one that has escaped me
Seems that This will be an easy question for you but this problem is
I'm a newer and if the question is so easy I apologize for that.
I have a question that should be quick and easy for you guys to
Hopefully an easy question. If I have an object and I want to call
got an easy question, using jquery, how do i create a menu, with links
This is an easy question and I want to confirm with you experts! I
I'm not sure that regexes are the best solution here, but they seem logical
This question originally asked which is the best method for uploading files via SFTP

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.