iphone 2d sprites - iphone

I am looking at building a 2d game for the iphone. I am using the cocos2d framework to build the game. However, I am not very good with graphics so I was hoping there were some good repositories out there for some free 2d sprites that are open source. I searched around but most of the articles are 2 years older or more. Does anyone have places they go to get 2d graphics for games? Also could I use 3d graphics in a 2d game and if so any resources for 3d graphics would be nice to.

I went down this road several times before. It is not fruitful. You will spend a lot of time trying to find free sprites. You amass lots of sprites all of which don't really fit what you need in terms of: looks, size, transparency, image format, shape, and what not. You'll waste time converting, scaling, filtering and otherwise mangling with these images. Still, the end result is nothing but a gross mashup of graphic styles.
As a game programmer with no artist, it's your job to define the size and shape of the images used in your game. An artist can later fill these out perfectly.
You'll be much better off to simply use dummy graphics which may not be more than a color gradient, a circle, an X, etc. But at least they're the correct size, shape and format. In particular size and shape will ultimately define how the game plays. You don't want that to be defined by whatever "free sprites" you can find.

Related

Create planet with Terrain in Unity

I'm looking to create some procedurally-generated planets in unity. I'm not looking to make huge, realistic planets, but very small, walkable ones (like Super Mario Galaxy).
I've run into a problem though - Terrain objects cannot be rotated, so I can't really make a sphere out of 6 separate squares.
I've tried importing a hi-res icosphere with limited success. It's difficult to make look good (even with a high number of faces) when up close. There's also limited support on terrain-like features on non-terrain objects - like how to blend textures, add grass, or place objects on the surface.
I have seen a few unity store assets that do exactly what I'm requesting, so I know something like this is possible. I just can't figure out where to start. I've searched for nearly anything related to the topic and found nothing.
Thank you!
You can write a shader that will curve your flat surface, like this:
https://www.assetstore.unity3d.com/en/#!/content/26165
and here is base code:
https://alastaira.wordpress.com/2013/10/25/animal-crossing-curved-world-shader/
I have used it while ago and with upgrades it works well.

Feasibilty/efficieny of using 3D models for a 2D game

I've been using Unity3D for a while now and I've also had experience coding 2D games using LibGdx.
In the past, I used to get my sprites off the net or make my own however that wasn't really the best way to do things since I'm more of a programmer and would sometimes need very specific things and so I've started to learn blender and I'm actually enjoying it atm.
What I want to know is how much of an overhead is it if you're using 3D models for a 2D game? Especially if you want to port it to mobile?
The overhead is significant for rendering since with a basic sprite, you have 6 vertices (2 tris to make a quad) while a 3d model can have hundreds of thousands of vertices.
The advantage on the other hand is that animations are made of sprites, so your texture amount and size may increase. In 3D, an animation is a text file so fairly light.
The physics is simplified in 2D since you can do surface collision while 3D requires volume collision and obviously checking an extra dimension is more expensive.
There are probably other considerations but those are the first coming in mind.
Now, the choice of 3D over 2D should be simply based on what you are trying to achieve. Side scrolling games like Angry Birds do not need 3D. Games like Taichi Panda are better with 3D despite being a 2D game (only x and z camera movement I think).
A FPS game should only be done in 3D or it will look like Duke Nukem.

how to deform image?

Hi Friends
I Want to make a simple gaming Application in which the user hit the car and car breaks from that point means the image get little deformed when the user hit the car image. I know everything could be possible with using of lots of images and get change when user hit that car image but i don't want to use so many images.
is there any solution for this , how can i deform the image ..sorry for my English but , here i paste a link of the game that is on flash and this is what i exactly want..
http://www.playgecogames.com/file.php?f=657&a=popup
please respond soon
thanks
You don't say if this is in 2D or 3D, or what techniques you're going to use.
If you're implementing the game using OpenGL, it's fairly straightforward. The object can be made up of a regular mesh, with the image as a texture mapped to the mesh. When the user hits the object, you just deform the mesh.
A simple method would be to take a vector in the direction of the hit, displace the nearest vertex by an amount proportional to the force of the strike, and then fan out in to deform the rest of the mesh in decreasing amounts. By deforming the mesh, the image texture will be rendered with all the dents or deformations you like.
If you want to to this without OpenGL and just straight images, you could use image resampling to simulate the effect. You have your original pristine image which is 'filtered' to make up the resulting image. At first there are no deformations so you copy the original image verbatim. Each time the user hits the object, you can add a deformation using a filter or transform within a local region of interest. This function would resample the source image in a distorted manner, causing it to look like the object is damaged.
If you look up some good books on game development, you'll find a great range of approaches to object collisions, deformations and so on.
If you know a bit about image processing technics here is the documentation for accessing the pixels of the image :
Apple Reference
You also have libraries for this such as this one :
simple-iphone-image-processing
But for what you want to do this might not be the easiest way. What I would suggest is that you divide the car into several images depending on what areas can be impacted. Then you just change the image corresponding to the damaged zone each time the car is hit.
I think you should use the cocos2d effects http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide%3aeffects + multiple images. Because there are many parts which drops after the player kick the car. Like when user kick the side mirror you should change the car image with without side mirror car image.
The person that has made that flash game used around 4 images to display the car. If you want the game to be in 2d, the easiest way is to draw the car, cut it into about 4 pieces (: left side + right side (duplicate of the left side) hood and roof).
If you want to "really" deform the car you'll have to use a 3d engine like openGLES.
Id really suggest doing it in 2d :)
I suggest having a look at the cocos2d game engine. You can modify images with effects, which are applied using a virtual grid. Have a look at the effects page in their programming guide.

3D free rotation of object

I have a 3D CAD file of a set of products. I want to create a viewer so that the user can freely rotate the object in 3D.
How would I best go about this?
1) I had thought about exporting a series of 360 degree images every 30 degrees around the image, but that would be around 360 images per product. Then right the code to handle the matrix that would be required to handle rotation of the object. Seems very excessive, but doable.
2) OpenGL - I have never done any 3d animation using this, though.
We are using LightWave 3D, if that helps.
I'd recommend going with the 3-D rendering route, even though it might require more upfront work than the multiple sliced images approach. It will provide much greater flexibility over the long run, and I think you'll be able to generate a more pleasing experience in the end (small application binary size, smoother rotation, etc.). Also, once you have the display code done, you'll be able to pull in arbitrary models to add on to the ones you started with, and make tweaks to those models more easily.
This question points out a number of ways that you might be able to import LightWave models into formats usable by an OpenGL ES application. It looks like you'll probably need to pass through Blender or another intermediary to accomplish this.
Once you have the model in a form that you can work with, you can build off of several open source 3-D rendering applications for the iPhone / iPad, such as my Molecules application. My application is built for displaying 3-D molecular structures, but people have modified it to support rendering other models for their own needs, so I know that's possible. I go into detail on how this application works in the video for the OpenGL ES session of my class on iTunes U.
OpenGL ES may seem intimidating at first, but it only took me three weeks of nights-and-weekends development to build the initial version of Molecules, and I had no real OpenGL experience before starting that project. There are many great resources out there now, so it's easier than ever to get started.

How do I create a floor for a game?

I'm attempting to build a Lunar Lander style game on the iPhone. I've got Cocos2D and I'm going to use Box2D. I'm wondering what the best way is to build the floor for the game. I need to be able to create both the visual aspect of the floor and the data for the physics engine.
Oh, did I mention I'm terrible at graphics editing?
I haven't used Box2D before (but I have used other 2D physics engines), so I can give you a general answer but not a Box2D-specific answer. You can easily just use a single static (stationary) Box if you want a flat plane as the floor. If you want a more complicated lunar surface (lots of craters, the sea of tranquility, whatever), you can construct it by creating a variety of different physics objects - boxes will almost always do the trick. You just want to make sure that all your boxes are static. If you do that, they won't move at all (which you don't want, of course) and they can overlap without and problems (to simulate a single surface).
Making an image to match your collision data is also easy. Effectively what you need to do is just draw a single image that more or less matches where you placed boxes. Leave any spots that don't have boxes transparent in your image. Then draw it at the bottom of the screen. No problem.
The method I ended up going with (you can see from my other questions) is to dynamically create the floor at runtime and then draw it to the screen.