Archive for the ‘C’ Category
Sunday, September 13th, 2009
OpenGL Bouncing Ball
I complied it with:
gcc ./bounce.c -I/usr/X11R6/include -lglut -lGL -lXext -lX11 -L/usr/X11R6/lib
It was interesting.
Now looking for an SDL version of opengl 3d bouncing ball.
Tags: 3d, Gaming, graphics
Posted in C, Gaming, methodology | No Comments »
Sunday, July 26th, 2009
Have you ever wanted to know how they simulate balls bouncing off each other and being pulled down by gravity? Here is some simple code using SDL and C that shows how it works.
Tags: 2D, elastic collision, graphics, physics, programming, SDL
Posted in C, Gaming, methodology, tutorial | No Comments »
Saturday, July 18th, 2009
http://www.google.com/#hl=en&q=sprite+collision+detection
http://www.gamedev.net/reference/articles/article735.asp
Huge collection of sdl tutorials : http://lazyfoo.net/SDL_tutorials/index.php
I created a very primitive sprite collision scheme built into my multi bouncing ball demo.
Here is the Youtube video: First Sprite Collision Attempt
Here is the code:
collision.c
You compile the code like this:
gcc `sdl-config –cflags –libs` collision.c
Enjoy.
Tags: animation, collision, SDL, sprite
Posted in C, Gaming, Language, methodology, netbook, tutorial | No Comments »
Saturday, July 18th, 2009
fontdemo.c
I had to install the SDL_ttf dev library to compile this one.
The command line to compile this is:
gcc `sdl-config –cflags –libs` -lSDL_ttf fontdemo.c
Notice the additional
-lSDL_ttf
that was added.
The original example code is here.
The arial ttf library is at that link. It has to be renamed to all lowercase to work.
I added a check to see [...]
Tags: font, graphics, SDL
Posted in C, methodology, programming, tutorial | No Comments »
Friday, July 17th, 2009
I revisit the ball bounce program I did earlier today and make the balls objects. The main program now works with a list of balls.
Tags: animation, SDL
Posted in C, Gaming, methodology, tutorial | No Comments »
Friday, July 17th, 2009
Bouncing Ball Program
The program loads the ball in and bounces it around the screen, as you can see in the screen shot.
I compiled the program with this command:
gcc `sdl-config –cflags –libs` bouncingball.c
Modified from the tutorial here.
Tags: animation, SDL
Posted in C, Gaming, methodology, tutorial | No Comments »
Friday, July 17th, 2009
Small demo code to make sure that the SDL libraries are installed correctly and that I can compile both C and C++ versions of the code.
Tags: example, SDL
Posted in C, CPlus, Gaming, methodology, programming, tutorial | No Comments »