Hi, I a trying to design a simple snake game to get acquainted with Corona. The snake becomes longer as it takes more and more dots. My question is how do I detect when the snake's head crashes against its own body? Do I make the snake as a physics body and use collision detection? If so, then how do I make the physics body grow longer with every dot the snake eats.
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Snake Game
The only version of Snake I ever really liked was the old-school version that came on the classic Nokie 8210's and 3310's (I believe those were the model numbers), and the snake was nothing more than a bunch of pixel blocks put together.
So, what you could do, is create little body pieces that are connected together (each with their own physical body), and then just create a new one every time the snake eats an apple. That way, you have growing taken care of, and the snake running into himself taken care of as well.
Just a starting point... good luck! Snake was awesome on oldschool nokias, and I haven't enjoyed any snake game on the iPhone yet ... maybe yours will change that!
Was your app successful?
views:1531 update:2011/10/4 17:12:07
热门文章
GameCenter LeaderBoards and Achievements Enabled Through OpenFeint
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
corona forums © 2003-2011