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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:46:47+00:00 2026-06-04T16:46:47+00:00

I am porting my game from Java to Objective C and I have a

  • 0

I am porting my game from Java to Objective C and I have a large amount of level data. I am hoping there is a simple way to change it over using some sort of replacement via regex.

The java format looks like this –

level1.addWave(240, 0, 120, 1, Constants.DOWN_STRAIGHT, .03f, 0.15f, 
Constants.WANDER_RIGHT, Constants.TOP_SIDE, 250, 390, Sheep.WHITE, 2);

and the Objective C version should look like this –

[level1 addWave_offset:0 waveTimer:0 nextSheepCD:0 numberOfWaves:1 startingDirection:DOWN_STRAIGHT wanderRate:0.03 wanderLean:0.15 
wanderDirection:WANDER_NONE side:TOP_SIDE minPixel:200 maxPixel:200 type:WHITE amount:1];

Is there a way to do this replacement via regex?

  • 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-04T16:46:48+00:00Added an answer on June 4, 2026 at 4:46 pm

    I have done similar things many times and my approach was following, i.e pseudo code:
    – Iterate over all files in all directories
    – Open file and read each line
    – If your line starts with level then do further processing
    – Further processing: Split the line with following tokens (, Constants., and ,. Trim the results to remove white spaces. Store each result in to associated temp variable (e.g. store level1 into tmp_level_id)
    – Use store results to generate Objective-C code

    While this may not be as beautiful as some funky regex it will be easier to implement and fix if necessary.

    Kind regards,
    Bo

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

Sidebar

Related Questions

I'm porting a game from UT3 to UDK. One of the classes is a
I am currently in the process of porting game code from PC to flash,
I'm porting a UT3 game to UDK . It uses a large code library
I have an iPhone game which I am porting to PC. The game uses
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I have a simple standalone application written in Visual Basic that I'm porting to
So I have been working on a 2 player Tic-Tac-Toe game in java that
I'm porting a 2D action game from Windows Phone 7 (developed in XNA 4.0)
I am developing a simple platform game in Java using BlueJ. Over the next
I'm porting a Hangman game to Android and have met a few problems. The

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.