what's the best way to create rolling terrain with Cocos2D?
I'd like to make a side scrolling flying game where the terrain (hills) is generated using mathematical functions .
Has anyone done that and if so, what's the best way to store all that data and to display it in Cocos2D?
Has anyone done that and if so, what's the best way to store all that data and to display it in Cocos2D?
Write your own OpenGL rendering inside of a Cocos2D node's draw method. Unless you want to make a tileset to do it... eww.
Cocos2D's utter lack of state management is pretty frustrating when writing your own rendering functions though.
Cocos2D's utter lack of state management is pretty frustrating when writing your own rendering functions though.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
I am suspecting you want to duplicate tinywings. See http://www.cocos2d-iphone.org/forum/topic/14136
Ugh. So much misinformation in that thread. Pixel shaders to procedurally draw a 1D heightmap? Really?
All you need is a triangle strip and a repeating texture. That's how ByteRacer does it: http://howlingmoonsoftware.com/extras.php and it's trivial.
The shading on the hills could be done with simple vertex coloring.
All you need is a triangle strip and a repeating texture. That's how ByteRacer does it: http://howlingmoonsoftware.com/extras.php and it's trivial.
The shading on the hills could be done with simple vertex coloring.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
rolling dice implementation | sefiroths | 5 | 9,690 |
Nov 11, 2010 10:18 AM Last Post: skyhawk |
|
Rolling My Own POD Exporter | earamsey | 2 | 4,139 |
May 24, 2009 06:39 AM Last Post: earamsey |