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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:15:19+00:00 2026-05-19T13:15:19+00:00

i am doing my first game like simple puzzle game. i an mew to

  • 0

i am doing my first game like simple puzzle game.

i an mew to gaming program.

i place a 4 image view in the view assign images to them by cropping one original image using this code.

int partId = 0;
    for (int x=0; x<=200; x+=100) {
        for(int y=0; y<=200; y+=100) {
            CGImageRef cgImg = CGImageCreateWithImageInRect(whole.CGImage, CGRectMake(x, y, 100, 100));
            UIImage* part = [UIImage imageWithCGImage:cgImg];

to get the image view position in the view i am using this code

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{
 // get touch event
 UITouch *touch = [[event allTouches] anyObject];
 CGPoint touchLocation = [touch locationInView:self.view];
 NSLog(@"%f %f",touchLocation.x,touchLocation.y);

Now what i need to when ever one image view comes near to the another image view then i need to exchange their positions.

eg: part1 come over part2 then part2 in the place1 of part one and part1 in the place of part2.

How can i done this can any one please help me.

Is this is correct approach to do this puzzle game.

Thank u in advance.

  • 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-19T13:15:20+00:00Added an answer on May 19, 2026 at 1:15 pm

    Well as you are using images you need to implement collision detection logic in your project. try some of the codes in http://apress.com/book/downloadfile/4587. it has very good examples on collision detection and it is free.

    and also try to read this book for game development on iphone

    http://apress.com/book/view/9781430225997

    Cheers

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

Sidebar

Related Questions

I'm doing my first DLL, a simple HelloWorld SharePoint Feature. The Feature has an
I am trying to do a simple pong game for 2 players. The first
I'd like to rank a collection of landscape images by making a game whereby
Doing my first SL4 MVVM RIA based application and i ran into the following
Doing my first tryouts with foreign keys in a mySQL database and are trying
I m doing my first steps with KSoap on Android (I m porting an
I'm doing my first project based on ASP.NET Membership and I'm having issues with
I'm doing the first bit of web-page development I've done in years, in VS2008,
I'm doing my first C++ - Qt4 application and I'm having some trouble connecting
i'm doing my first applications using JDBC/Oracle... Today i had a problem and i

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.