Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-08-2010, 10:12 PM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Question Platform game

I have just started learning about how to use Iphone SDK. I am planning on developing a simple little game. In this game there will be platforms that move up towards the top of the screen. Each of the platforms will have a hole in it. The main character will be a ball and you will have to keep going through the hole going through different and repeated platforms. If you don make it through a platform in time it will bring you to the top of the screen and you will loose. The objective is to see how long you stay in the game. I can probably do all the designs pretty decent it is just the coding I have trouble with. Do you think anyone could help or show me a tutorial?
talakoski is offline   Reply With Quote
Old 02-08-2010, 10:21 PM   #2 (permalink)
Developer
 
TapTouchClick's Avatar
 
Join Date: Jan 2010
Location: Bay Area, CA
Posts: 185
Send a message via AIM to TapTouchClick Send a message via Skype™ to TapTouchClick
Default

No one is going to give you all the source code for something like that. There are no tutorials for full games. I suggest breaking it down into pieces and reading a few books and watching tutorials on each part. But really it will take months. its not a simple game. If you want it be done fast, i would suggest hiring someone to create the code for you.
HTH
__________________
Im hoping we can help eachother out.

Check me out at My Website
TapTouchClick is offline   Reply With Quote
Old 02-09-2010, 07:05 AM   #3 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Default

Quote:
Originally Posted by TapTouchClick View Post
No one is going to give you all the source code for something like that. There are no tutorials for full games. I suggest breaking it down into pieces and reading a few books and watching tutorials on each part. But really it will take months. its not a simple game. If you want it be done fast, i would suggest hiring someone to create the code for you.
HTH

ok
talakoski is offline   Reply With Quote
Old 02-09-2010, 03:30 PM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 2,565
Default

I would definitely start with one *stationary* platform at the center of the screen, get that working, and once you understand that it will be easier to expand to multiple platforms.

There's code in this thread, which explains how to add images to the current view and how to move them around. How will you control the ball, by the way? Swiping the screen, or accelerometer?
Random Rocks

Do not copy that code directly, but look for the method for adding imageviews and moving imageviews.

I'd make one "platform" graphic that's wider than the screen and with a hole in the center. That'll make the math easier. For now, put one platform at y=100, with the center at x= 150.

For the motion of the ball, you'll want it to fall down unless it's rolling on the platform, right? You know it's on the platform when the y value of the ball is just a little less than the y value of the platform. Then you can change to the rolling behavior.

In short, I'd break it down into getting these steps working:
1) get a ball falling down the screen
2) add the platform
3) get the ball to stop when it hits the platform
4) get the ball to roll in the right direction when it's on the platform
5) get the ball to fall through the hole (when ball center x is close to platform center x)
6) change to an array of platforms; you'll have to use a loop to check each platform.
7) change code to make platforms move up, and "push" the ball up when the ball is on a platform.
__________________

Last edited by smasher; 02-09-2010 at 03:32 PM.
smasher is offline   Reply With Quote
Old 02-10-2010, 02:22 PM   #5 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Smile Ball

I have now opened up a Viewed based application and imported a picture into the resources folder but now I got to add a code I think I can get a code but now I forget where to put the code in the classes?
talakoski is offline   Reply With Quote
Old 02-10-2010, 02:48 PM   #6 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 2,565
Default

Quote:
Originally Posted by talakoski View Post
I have now opened up a Viewed based application and imported a picture into the resources folder but now I got to add a code I think I can get a code but now I forget where to put the code in the classes?
Most of your code will probably go in the viewController. It'll be called "MyViewController" or something similar containing the name of the project. You can put your code to create the ball in loadView or viewDidLoad, and the to start the timer in viewDidAppear.
__________________
smasher is offline   Reply With Quote
Old 02-12-2010, 04:34 PM   #7 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 8
Smile

Quote:
Originally Posted by smasher View Post
Most of your code will probably go in the viewController. It'll be called "MyViewController" or something similar containing the name of the project. You can put your code to create the ball in loadView or viewDidLoad, and the to start the timer in viewDidAppear.
Ok just finding some codes
talakoski is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Online Users: 680
15 members and 665 guests
ali.dar, Ath, Ed99, harry123456, kristapsz, lokidil, maccoykung, pereorra, rarindeed, rendezvouscp, SteveMobs, thadre, Thaurin, warcrow, _Mac
Most users ever online was 779, 05-11-2009 at 09:55 AM.
» Stats
Members: 24,162
Threads: 38,935
Posts: 170,827
Top Poster: smasher (2,565)
Welcome to our newest member, ddustin
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:06 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0