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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:03:23+00:00 2026-05-23T03:03:23+00:00

So i have a old game i made, i wanna try make it for

  • 0

So i have a “old” game i made, i wanna try make it for iPhone(ofc).

Can some one please help me try rewrite this into cocos2d ? im using xcode 4, think thers a bit different about the releases, of what i have heard, but dunno..

But thanks in advance

heres my AS3 code:

for (i = 0; i < 11; i++)
{
    columns = [];
    for (j = 0; j < 11; j++)
    {
        _place = new place();
        _place.thisX=i;
        _place.thisY=j;
        _place.thisDistance=Math.min(i+1,j+1,11-i,11-j)*11;
        _place.y = 56 * i + 3;
        _place.x = 5 + 71 * j + 35*(i%2);
        _place.buttonMode=true;
        _place.addEventListener(MouseEvent.CLICK, setBlock);
        columns[j] = _place;

        addChild(_place);
    }
    rows[i] = columns;
}

i’ve got this so far, but its prob. wrong

place = [CCSprite spriteWithFile:@"place.gif"];

        int *i;
        int *j;
        CCSprite *_place = place;
        CCArray *columns;

        for (i = 0; i < 11; i++) {
            columns = [];
            for (j = 0; j < 11; j++) {
                _place.position.x = ccp(i);
                _place.position.y = ccp(j);
            }
        }
  • 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-23T03:03:24+00:00Added an answer on May 23, 2026 at 3:03 am

    are you sure your code is written in c++, objective-c or just native c? this is how you have to implement your code :

    CCSprite *places[11][11];
    for(int i=0;i<11;i++)
        for(int j=0;j<11;j++)
        {
            places[i][j] = [CCSprite spriteWithFile:@"place.gif"];
            places[i][j]->position = ccp(i*11,j*11);
        }
    

    and you can also add [layer addChild:places[i][j]] at the end of for loop to add them to your layer at creation time.

    –edit–

    and for creating a UI just as I can get from your AC3 script I would prefer using CCMenu class:

    something like this :

    CCMenuItemImage *places[11][11];
    CCMenu* menu = [CCMenu menuWithItems:nil];
    for(int i=0;i<11;i++)
        for(int j=0;j<11;j++)
        {
            places[i][j] = [CCMenuItemImage itemFromNormalImage:@"place.gif" selecetedImage:@"place.gif" target:self selector:@selector(clickEvent)];
            places[i][j]->position = ccp(i*11,j*11);
            [menu addchild:places[i][j];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bit of an unusual question. I'm running an old DOS game
I have an old web app where Javascript is used to validate some dates.
I have an old program pushing some data from a Microsoft SQL server database
i have this game like doodlejump i inserted some monsters and bullets on the
So I've spent a lot of time making an iPhone game and have recently
An old game (Pod) is kept alive with a glide wrapper and thus can
I have some amount of older game code that I am porting over to
I have a game server written in python and twisted, and an old game
I'm trying to make a small game using (free)GLUT. I know that it's old
I have a two year old game code which was completely written in cpp

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.