Page 1 of 1

Game Maker sample games/examples converted to Purebasic

Posted: Fri Aug 28, 2009 10:12 am
by Teng
Some simple 2d 3d demos / examples I've converted from Game Maker sample files made by other GM users to PureBasic to familiarize myself with PB. Source and media files only. For beginners to PureBasic like myself :lol: .

Download at :
http://host-a.net/Teng/

Game Maker List of examples :
1945 (horizontal shooter, use arrow keys to move and left ctrl key to fire)
asteroids (same control scheme as 1945)
hit the ball (click on the ball with your mouse cursor to score)
scrolling star field
rotating star field
rotating wireframe cube
rotating solid cube
mode7 effect
isometric maze
parallax scrolling
parallel scrolling
perspective scaling

Made with Purebasic 4.31 demo version x86. Not sure I should post it here since this section is for 'advanced game related topics'. If not mods can delete this post.

Posted: Fri Aug 28, 2009 2:12 pm
by Lost
Thanks mate, I'll definately have a look at them.

Posted: Fri Aug 28, 2009 7:26 pm
by Rook Zimbabwe
Interesting idea... I am at work and cannot Download anything... how did you convert the samples? Did you just use the graphics? Details are important! :D

Posted: Sat Aug 29, 2009 5:57 am
by Teng
Rook Zimbabwe:
Many people seem to think that Game Maker is just a drag and drop game builder like Klik 'N' Play or Multimedia Fusion. This is far from the truth, Game Maker has a built in scripting language GML, the syntax of GML is easily converted to PureBasic. I included the source Game Maker files with the Purebasic sources you can take a look at them. Just remember :
*.gm6 files should be opened in Game Maker version 6
*.gmd files should be opened in Game Maker version 5 or below

The latest extension is *.gmk which can only be opened in Game Maker 7.

Example of actual GML code for the scrolling starfield :

Code: Select all

numberOfStars = 150;
lensFactor = 50;
starSpeed = -5;
zMin = 10;
zMax = 2000;
xSpan = 10000;
ySpan = 10000;
cx = screen_width / 2;
cy = screen_height / 2;

for (i = 0; i < numberOfStars; i += 1)
{
	stars_x[i] = random(xSpan) - xSpan / 2;
	stars_y[i] = random(ySpan) - ySpan / 2;
	stars_z[i] = random(zMax - zMin) + zMin;
}

for (i = 0; i < 256; i += 1)
{
	starColor[i] = make_color(i, i, i);
}

myTextColor = make_color(50, 200, 0);
You give me too much credit... :lol:

Posted: Sat Aug 29, 2009 6:19 pm
by luis
Nice conversions, good idea to familiarize with pb !

Thanks for sharing.