Infinite, noise-generated tile map in Cocos2d/ios? - cocos2d-iphone

I have been working for weeks on a game concept in java, and have decided it will be best to implement the game in iOS, primarily for iPad. I wrote everything myself in java and am now researching what I need to do to convert.
I haven't decided on a framework but am eying Cocos2d. However, I've not been able to find any information on a recommended method to make an infinite map. Infinite side-scrolling yes, but mine is is "infinite" in all directions.
Currently, I generate "chunks" of 16x16 tiles that are assigned biome/type info by a perlin/simplex noise generator. I wrote custom code that loads/unloads each chunk of tiles as you move. You may move in all directions.
Is this possible with the Cocos2d library? Or will I need to re-write my special rendering/map movement code in Objective-c?

Related

Basic 3D OpenGL collision detection C++

I'm currently in the process of developing a very basic 3D OpenGL game in C++ as part of a small college project. We don't get a lot of insight from the teachers however, and only very limited documentation, as well as a small timeframe, so I'm kind of a little lost here at the moment.
My game is a tank battle on an orthogonal plane that pretty much looks exactly like the image I sketched below. Each tank (A and B) can be controlled by a different player, and each one can shoot projectiles, which are supposed to influence the other tank's score upon collision.
My question is, what would be the simplest way of effectively implementing collisions for the tanks? (Tank vs tank, tank vs map boundaries and tank vs any kind of parallelepipedic object like the one in the center of the picture - and the same thing but applied to the projectiles shot from the tank turrets).
Ideally, without the need of using an external physics engine, but also accepted if the implementation can be done easily. At the moment, I'm solely using the GLUT library.
Download and integrate Box2D (http://box2d.org) into your project.
Unless your project is to implement a physics engine, then don't bother doing it yourself. Your time will be much better spent learning how to integratate libraries and how proper physics engines work.
You can then easily use a box collider for your tanks, circle for projectiles and 4 lines for your perimeter. You can create callbacks to notify you when a projectile has collided with another tank.
You will have to use forces and torques to move and rotate your tanks, rather than just updating their positions. But you would probably have to do that anyway if you were going to implement the physics yourself.

How do I detect collision with C++, OpenGL, and freeglut?

I am making a maze game, and I know how to do everything except make it so that you can't just cheat your way through the walls. I am using freeglut with OpenGL in C++ and I would like to know the most effective way of using collision detection ( hopefully without needing to use anything other than freeglut).
OpenGL is just for drawing; it makes things appear onscreen at the coordinates you specify, but it doesn't play a role in deciding what the coordinates of your objects should be. For motion and collision, you may want to use a physics library, such as ODE or Bullet. (There are also bigger, more commercially-oriented physics systems like Havok and PhysX, but those are probably overkill for a simple project.)

C++ using animations from Flash or similar

I want to program a game, and I want to do it in C++, because everyone seems to agree this is the best way to program a game. What I really want, though, is the ability to animate something, swap images around during runtime, and retain the animation. Also, the ability to pin graphics to certain parts of other graphics, or group graphics together. I know for sure Actionscript and Flash can do both of these. It's especially easy in Flash because I can visually see the animation and swap symbols via Actionscript to change it to what I want at whichever frame I want. Now, I know that it's fairly simple to swap images during runtime in C++ as well, but in C++, (from my understanding) I would have to animate via code and I would have to manually move each graphic separately for the graphics to stay together. Is there's a way where I can animate in Flash, then use those animations and swap images in C++? Or, if there's some other way to accomplish the same thing, without using Flash? (don't mind using bitmaps)
I think maybe you should just program your game in Flash and ActionScript, if you're already experienced with those tools and your game can fit in them. Programming a game in C++ is a difficult and complex task, necessary for difficult and complex games but often overkill for simple and fun design. If you just want to design games, go with the simplest tool that lets you make your prototype!
If your game is too big to implement in Flash, consider using XNA, or a prebuilt game engine such as Ogre or Unity. XNA is in C♯ but even that is good enough for any game that a one-man team could build.
Scaleform lets you embed Flash in a C++/DirectX game, but as you can see it is rather complicated to employ. We have one engineer and three artists dedicated full-time to Scaleform UI on our project, to give a sense of how much work it is.

Ogre game programming using TDD

I'd like to ask you if it's worth it to use the TDD concept while creating a 3D game in C++ with Ogre? I know I can use it while creating my algorithms (like path-finding, AI, paging, etc.) and the game logic, but can it be used to test the drawing side? I mean if the proper objects are drawn, if the proper animation is set & used and a lot of other "things" that I don't want to enumerate.
I've been searching about it for days but I haven't found the answer that I can accept.
Basically which part of game development should be done with TDD and which part not? Does 3D game development need TDD?
Ogre uses so many Singletons and other global state, I find it difficult to see how you could implement meaningful tests for it- even ignoring the difficulty of testing the accuracy of a rendered image.

Using an existing C++ engine on the iPhone

I come from a C/C++ background and more recently flash. Anyway I wrote a 2D engine in AS3 and would like to get it running on the iPhone. To start with I converted it to C++. As a test I wrote a very simple C++ engine and added the files to a standard view-based application in XCode. I then added a UIImageView that covered the whole iPhone screen.
The way my test engine is set up at the moment is that each frame it renders the result to an image which is then used to update the UIImageView every frame. Assuming I can pass input from the iPhone to the C++ engine this seems like a fairly platform-independent solution. Since I have been coding for iPhone/Mac for less than 1 day I was wondering whether this is the standard approach to getting an existing C++ engine running on the iPhone and if not, what is?
There's no problem in you rendering into an image and refreshing that image, but you get no acceleration from the GPU using this technique. So you'd be burning a lot of CPU cycles, which in turns eats battery.
If the objects you are rendering can be described in normal graphics primitives, be sure to use the drawing APIs which are optimised for the platform and can delegate work to the GPU.
An alternative approach is to make use of OpenGLES, but this has a learning curve
Yes, that is a fairly normal way to handle it. Generally you would either use small Objective C stubs for your events and things like pushing out the frame, or you would setup an OpenGL context and then pass it to your C++ code.