I'm trying to figure out how to set up a 2D top-down view game. I assume tile mapping is a pretty good start. Im using basic sprites for character and the ground tiles. Anyone know of a good tutorial and setup guide i could use?
Sorry for the late answer but in my search for the same thing as you I found these results:
C++ Tile Engine from Scratch -- Part 1
C++ Tile Engine from Scratch -- Part 2
C++ Tile Engine from Scratch -- Part 3
C++ Tile Engine from Scratch -- Part 4
I hope it helps :)
Related
I'm working on a C++ project using a ToF camera. The camera is inside a room and has to detect walls, doors or other big planar surfaces. I'm currently using OpenCV but answers using other C++ libaries are also okay. What is a good algorithmn to detect the surfaces, also if they are rotated and aren't facing the camera directly. I've heard things like making a point cloud and using RANSAC. If you suggest me doing that please explain it in detail or provide a resource for explanation, because I don't know much about this topic (I'm a beginner in computer vision).
Thanks for your responses.
Are you familiar with PCL?
This tutorial shows how to find planar segments in a point-cloud using PCL.
Note: I am rather new to programming, even more-so game programming, so I apologize if my question is rather broad but it's hard to find a tutorial for this topic.
Description of Project
A simple endless side-scrolling runner similar to Canabalt where the player may tap on the screen to make the character jump. The only movement allowed to the character sprite is along the y axis.
What I Have...
A scrolling parallax background.
What I Want...
A character sprite that has a bounding box
A ground sprite that has a bounding box
A way to tell when either is touching/intersecting
A means to keep them from continuing to intersect
What I've Tried...
Ray Wenderlich's Tutorial (semi-outdated, also is tile-based which I didn't like very much and seemed quite prone to buggy-ness)
There are really two parts to my question:
For a beginner to physics, is it recommended to just stick with an API like Chipmunk or Box2D?
if first question == FALSE
What is the best way to go about building my own physics engine given the above information?
Thank you in advance for any tips/advice you may share. :)
Might I suggest using Chipmunk. Like you, I too wanted to build a game with a minimalist but efficient collision detection and force manipulation system. After loads of frustration and days wasted trying to implement some basic physics, I gave up and decided to learn an engine. Chipmunk, though intimidating at first glance, is actually very simple to learn. I have been able to use it in projects for just simple, efficient collision detection, as well as full-fledged physics-simulations.
There are a couple different versions of chipmunk (chipmunk pro, studio, etc.) that are arguably even easier to use than the original. I managed to get bye with the basic chipmunk after reading through a few code examples provided within chipmunk. Additionally, SpaceManager is a wrapper for chipmunk in obj-c that allows you to ignore all the c-based functions. It provides a lot of convenient methods for building spaces, adding bodies and sprites, and manipulating objects. It can be found here: http://code.google.com/p/chipmunk-spacemanager/
Unless you are very, very well versed in many areas of physics, don't try implementing your own engine.
I understand that cocos2d it's really simple API, and that I can use it to do simple and huge 2D or even sometimes 3D games/applications. As well I understand that OpenGL it's more complicated, it's lower level API etc.
Question: What is better for implementing 2D/3D games? Why do we need to learn OpenGL if we have simple frameworks like cocos2d? What you can do with OpenGL that you can't do with cocos2d?
Thanks in advance!
What is better for implementing 2D/3D games?
Hard to tell, but a higher level API is always there to make things easier for you. For example you are writing a 2D shootem up. You will likely use a game loop, you will want to use sprites and make those move on the screen. You may want animations like explosions taking place. You'll end up writing your own higher level API to do those things. Cocos2D has solved those problems for you already. Any other frameworld should have solved it.
Why do we need to learn OpenGL if we have simple frameworks like cocos2d?
In case you like to cusomize the standard behaviour of a framework, especially the drawing part, you should get into openGL. If there is something you like to have which doesn't come out of the box you may find yourself reimplementing a base framework class. For example, look at the shaders used in Cocos2D 2.0. If you like some special blending mode, like a tinting effect, you won't get it for free. There is a colour attribute for a CCSprite but this may not be the result you're expecting. So you'll have to write your own shader and plug it into the sprite you like to be displayed in a different way.
What you can do with OpenGL that you can't do with cocos2d?
This comparison doesn't really work out, since cocos2d facilitates opengGL for the drawing part to build up that higher level api and make your life easier as a game developer.
Cocos2d is a wrapper around the 2D features of OpenGL (as of this: http://www.cocos2d-iphone.org/about) . Under the hood it itself uses OpenGL ES to implement its features. This is good because it means that there will be minimal performance overhead so you can start using its simpler API without having to get immersed to the definitely bigger learning path of OpenGL.
It has however only strong 2D support and if you plan to write later 3d games you loose all benefits of Cocos2d: why would you rewrite a 3d rendering engine with a 2d framework that under the hood uses a very strong 3d engine? You loose performance for a lot of unnecessary work.
So the simpler answer is: for 2d Cocos2d, for 3d OpenGL.
If you want to start OpenGL ES, this is a very good tutorial for beginners: http://iphonedevelopment.blogspot.it/2009/05/opengl-es-from-ground-up-table-of.html
I am trying to make an ARDRONE(a quadrotor) to navigate trhough a maze.
I am using ROS-ELECTRIC and OPENCV. I have implemented hough line transfrom. I need to implement the vanishing point algortihm to make the robot navigate autonomously. I am new to opencv . Could you guys please suggest the approach to attain the vanishing point? and also will it serve the purpose of navigating the robot through a maze and find the target?
thank you
You can check this http://marcosnieto.net/#PhD in the code.
OpenCV implementation based on the author's PhD thesis.
It works for me, but up to 2 vanishing point in my test.
I'm really new to OpenGL, which is a really bad thing to me :|
I need to draw a star(sort of) with openGl but I'm not really sure where I should start.
The results should be something like this:
Is there an easy way to do this?
the easiest way would be to draw a texture mapped quad with a "star" texture. You can read a tutorial on texture mapping here: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06
That tutorial teaches how to draw a cube using textures.
You just have to draw a single face, instead of all six.
The tutorial is written in C++, but near the end you can download the source of a Delphi version.
There are other effects you might want to add later, such as transparency. You can also read about that in the NeHe site. It has a lot of useful tutorials on OpenGL. It's a great place to learn OpenGL.
If you're new to OpenGL and if you're using Delphi, then most probably what you need is GLScene. Mature, alive, very good quality of code and, of course, free.
Why not write an algorithm to generate a texture procedurally in code using a 2D GLuByte array as in the "checker.c" example in Redbook? Instead of following a perfect checkerboard pattern, figure out how to make a 2D texture of that star and map it into a quad using glTexImage2D(...).