Sign in to follow this  
Kancho

Blitzmax for somebody new to programming?

Recommended Posts

Hey guys, I guess the title says it all. I am new to programming, I fancy getting into making some small little games, and you never know in a few years time making some little Indie titles, nothing too crazy. I have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics. Would this be a fair estimation? I feel like if I spend my time learning Blitz, then I am not really learning core programming techniques, instead learning how to manipulate the library. One example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle. Would I be better off getting my feet wet with something like Python->pygame? How does pygame present itself to someone who would be new to programming? Or maybe something like C-Allegro? Thanks guys. <Sorry for my terrible and rushed grammar. Trying to get the post in before my net disconnects>

Share this post


Link to post
Share on other sites
I haven't had any experience with Blitzmax but back when I began programming I got a book on a version of the Blitz language and really disliked it (and I was a beginner back then).

I personally would suggest XNA Game Studio by Microsoft. XNA is a wrapper over the DirectX framework to heavily simplify game development. It utilizes the C# language so you would have to learn that, but you mentioned wanting to learn "core programming techniques" and you can do that with something like C#. Take some time learning C# and then move into XNA slowly, making sure you understand what you're writing. You can find XNA's website here.

Whichever language/library you choose I would suggest learning the core language first. Game development is typically a difficult programming field (lots and lots of techniques) and even though there are loads of tools out there created to make creating games easy, most will require some basic knowledge of core programming techniques.

Share this post


Link to post
Share on other sites
Quote:
Original post by KanchoI have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics. Would this be a fair estimation?

Not really, no. There are users of all skillsets using BlitzMax. Some are experienced, some are beginners. It's a hell of a lot less intimidating, obscure and labyrinthine than C++, which is good for beginners. It's true that - much like C# and Java - it's design emphasis is on making coding fun and quicker than certain other languages, but it's certainly not true that you need to be an experienced programmer to appreciate any of that.

Quote:
Original post by KanchoOne example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle.

That's an example of the precise opposite of what you claim. cin isn't part of the C++ language, it's part of the iostream library. Also, BlitzMax does have such a command. It's called Input, and it's well documented in the help files.

Quote:
Original post by KanchoI feel like if I spend my time learning Blitz, then I am not really learning core programming techniques, instead learning how to manipulate the library. Would I be better off getting my feet wet with something like Python->pygame? Or maybe something like C-Allegro?

Well not if you're intent on "learning core programming techniques" and avoiding "learning how to manipulate a library" since PyGame and Allegro are both libraries. Frankly, I'm not sure I see the distinction. There's not much you can do with any programming language without learning to manipulate libraries, particularly for game development. If you were learning C++, I'd expect that learning about the STL (Standard Template Library) would be a big part of that.

Not to appear discouraging, but if you're finding BlitzMax too difficult, I can't see you having an easier time with Python or C. It sounds to me as though your real problem is that you want to be rushing through the basics far quicker than anyone really can when they're starting out, and you're getting frustrated at the lack of progress. Lack of progress is normal when you're learning, as is getting frustrated by it. You really have two options. Either stick with it and keep going until you get there, or find something with a completely different paradigm. Switching languages won't help you at this stage, it'll just make things even slower as you have to start all over again. Not to mention unlearning some of the things you just learned. If you want to switch paradigms, then consider something like GameMaker, Flash or MultiMedia Fusion, where you can get stuff up and on screen without actually having to learn much programming. Then you can come back to BlitzMax, C or Python when you've picked up some experience with that.

Share this post


Link to post
Share on other sites
I use Blitz 3D at the moment and while great for prototyping and making simple/dirty games it's not something I'd want to keep doing for much longer.

That said I migrated from there to some basic C++ (shown below although I'd say its some pretty poor quality code and it's for a cross platform system) in about a week or two, once you've learned one language others come pretty quickly although I've forgotten much of it almost as quickly.

It's a good language to start with though if you're interested with games design as you can really get to grips with algorithms such as game physics pretty quickly.

#include <KD/kd.h>
#include <KD/KHR_float64.h>
#include <vector>
#include <algorithm>
#include <GLES/gl.h>

EGLDisplay display = EGL_NO_DISPLAY;
EGLSurface windowSurface = EGL_NO_SURFACE;
EGLContext context = EGL_NO_CONTEXT;

static KDboolean setupEGL();
static void releaseEGL();




class Plane {
public:

void UpdatePlane(); //Updates variables

float worldX, worldY; //Position of plane on a 'world' scale rather than on screen, 1 unit = 1m
float bearing; //Y axis is effectively North
float velocity; // 1 unit is 30m/s (108kph)

KDboolean firing;
KDust waitFireTimer;

/* Notes:
* A Spitfire MkV's max speed is around 600kph
* A good cruising speed for a sea plane would be around 400kph
*/


};

void Plane::UpdatePlane() {

//Update the Plane's position

float plusX, plusY;

plusX = velocity * kdSinKHR(bearing);
plusY = velocity * kdCosKHR(bearing);

worldX += plusX;
worldY += plusY;

if (firing == KD_TRUE) {
if (kdGetTimeUST() > waitFireTimer + 1000000000/5) {
kdLogMessage("Fired. ");
waitFireTimer = kdGetTimeUST();
}
}

}

class PlayerPlane : public Plane {
public:

PlayerPlane(float x, float y, float a);

};

PlayerPlane::PlayerPlane(float x, float y, float a) {
this->worldX = x;
this->worldY = y;
this->bearing = a;
this->velocity = 4;
this->firing = KD_TRUE;
this->waitFireTimer = kdGetTimeUST();
}

class EnemyPlane : public Plane {
public:

EnemyPlane(float x, float y, float a, float v);
//Most of this is AI stuff


};

EnemyPlane::EnemyPlane(float x, float y, float a, float v) {
this->worldX = x;
this->worldY = y;
this->bearing = a;
this->velocity = v;
}

class Bullet {
public:

void UpdateBullet(); //Updates variables
Bullet(float x, float y, float a, float v);

float worldX, worldY; //Position of plane on a 'world' scale rather than on screen
float bearing; //Y axis is effectively North
float velocity;

};

Bullet::Bullet (float x, float y, float a, float v) {
this->worldX = x;
this->worldY = y;
this->bearing = a;
this->velocity = v;
}

void Bullet::UpdateBullet() {

//Update theBullet's position

float plusX, plusY;

plusX = velocity * kdSinKHR(bearing);
plusY = velocity * kdCosKHR(bearing);

worldX += plusX;
worldY += plusY;

}

class Factory
{
private:
static std::vector<Bullet *> allBullets;
static std::vector<Plane *> allPlanes;

public:

static Bullet *createBullet(float x, float y, float a, float v)
{
Bullet *bullet = new Bullet(x, y, a, v);
allBullets.push_back(bullet);
return bullet;
}

static EnemyPlane *createEnemyPlane(float x, float y, float a, float v)
{
EnemyPlane *plane = new EnemyPlane(x, y, a, v);
allPlanes.push_back(plane);
return plane;
}

static PlayerPlane *createPlayer(float x, float y, float a)
{
PlayerPlane *plane = new PlayerPlane(x, y, a);
allPlanes.push_back(plane);
return plane;
}

static void forEachBullet(void (*f)(Bullet *p))
{
std::for_each(allBullets.begin(), allBullets.end(), f);
}

static void forEachPlane(void (*f)(Plane *p))
{
std::for_each(allPlanes.begin(), allPlanes.end(), f);
}

};

std::vector<Plane *> Factory::allPlanes;
std::vector<Bullet *> Factory::allBullets;


static KDTimer *timer;
static void quit_callback(const KDEvent *e);
static void timer_callback(const KDEvent *e);
static void input_callback(const KDEvent *e);
static void updateAllPlanes(Plane *p);
static void updateAllBullets(Bullet *p);
static void *gametimer;
#define NANO_SECS_PER_SECOND 1000000000;
static KDboolean keys[5];
void *player;
#define KEY_FIRE 0;

// Main Program
// ##################################################################


KDint kdMain(KDint argc, const KDchar *const *argv)
{

player = Factory::createPlayer(0,0,0);
setupEGL();
const KDEvent *e;

/* set up a timer to redraw 30 times a second */
KDint64 interval = (KDint64) 1000000000 / 30;
timer = kdSetTimer(interval, KD_TIMER_PERIODIC_AVERAGE, gametimer);

/* main event loop. */
if (timer != KD_NULL) {

/* Initialise Timer, Quit and Input callbacks. */
kdInstallCallback(timer_callback, KD_EVENT_TIMER, gametimer);
kdInstallCallback(quit_callback, KD_EVENT_QUIT, KD_NULL);
kdInstallCallback(input_callback, KD_EVENT_INPUT, KD_NULL);


while ((e = kdWaitEvent(-1)))
{
kdDefaultEvent(e);
}
}

/* Deinitialise context */
releaseEGL();
return 0;
}







Unfortunately the OOP in Blitz is very simple, effectively a stack of structs, i.e each class only has variables attached to it, no operations, and no sub-classes

Also the same game in B3D (note C++ version was no-where near completed and I cut half of it out while this is the full game) And this is cruddy code, don't copy it; I managed to get a memory leak in Blitz somehow.

Global GfxW = 640
Global GfxH = 480
Include "Menu.bb"

.NewGame
Graphics GfxW,GfxH,0,1
SetBuffer BackBuffer()
ClsColor 0,67,171
AutoMidHandle True
SeedRnd MilliSecs()

Type Player
Field X#,Y#,A,F#,Z#,H,L
End Type

Type Bullet
Field X#,Y#,A,S,L
End Type

Type Cloud
Field X#,Y#,S
End Type

Type Enemy
Field X#,Y#,A,R,Z#
End Type

Type Explosion
Field X#,Y#,F
End Type

Type Carrier
Field X#,Y#,A,P,S,R,H
End Type

Const Rotations = 90

Global ShellExplosion = LoadImage ("Images/ShellFire.bmp")
Global LandImg = LoadImage ("Images/Land.bmp")
Global PlayerImg = LoadImage ("Images/Plane.bmp")
Global EnemyImg = LoadImage ("Images/Enemy.bmp")
Global ExplosionImg = LoadAnimImage("Images/Explosion.bmp",32,32,0,6)
Global ShipImg = LoadImage ("Images/Ship.bmp")
Global CarrierImg = LoadImage ("Images/Carrier.bmp")
Global ShadowImg = LoadImage ("Images/Shadow.bmp")
Global WaterTile = LoadImage("Images/Water.bmp")
Global FuelWord = LoadImage ("Images/Fuel.bmp")
Global AirspeedWord = LoadImage ("Images/Airspeed.bmp")
Global SpeedWord = LoadImage ("Images/KPH.bmp")
Global AltitudeWord = LoadImage ("Images/Altitude.bmp")
Global HeightWord = LoadImage ("Images/Ft.bmp")
Global CloudI = LoadImage ("Images/2x2 Cloud.bmp")
Global CloudII = LoadImage ("Images/3x3 Cloud.bmp")
Global CloudIII = LoadImage ("Images/4x4 Cloud.bmp")
Global ArrowImg = LoadImage ("Images/Arrow.bmp")
Global EnemyArrowImg = LoadImage ("Images/EnemyArrow.bmp")
Global AllyArrowImg = LoadImage ("Images/AllyArrow.bmp")
Global EnemyCarrierArrowImg = LoadImage ("Images/EnemyCarrierArrow.bmp")
Global AllyCarrierArrowImg = LoadImage ("Images/AllyCarrierArrow.bmp")
Global HUDImg = LoadImage ("Images/HUD.bmp")
Global HUDPlaneImg = LoadImage ("Images/HUDPlane.bmp")
Global PlayerDamageImg = LoadAnimImage ("Images/Damage.bmp",32,32,0,6)
Global BulletImg = LoadImage("Images/Bullet.bmp")
Global Number = LoadAnimImage ("Images/Numbers.bmp",10,13,0,10)
Global FuelBarHolderImg = LoadImage("Images/FuelBar.bmp")
Global FuelBarImg = LoadImage("Images/FuelRemaining.bmp")
Global Propellor = LoadSound("Sound/Prop.wav")
Global PlayerShellSound = LoadSound("Sound/Shot.wav")
Global EnemyShellSound = LoadSound("Sound/Shot.wav")
Global ExplosionSound = LoadSound("Sound/Explosion.wav")

MaskImage ShellExplosion,0,67,171
MaskImage LandImg,0,67,171
MaskImage PlayerImg,0,67,171
MaskImage EnemyImg,0,67,171
MaskImage ShipImg,0,67,171
MaskImage CarrierImg,0,67,171
MaskImage ExplosionImg,0,67,171
MaskImage ShadowImg,0,67,171
MaskImage CloudI,0,67,171
MaskImage CloudII,0,67,171
MaskImage CloudIII,0,67,171
MaskImage ArrowImg,0,67,171
MaskImage EnemyArrowImg,0,67,171
MaskImage AllyArrowImg,0,67,171
MaskImage EnemyCarrierArrowImg,0,67,171
MaskImage AllyCarrierArrowImg,0,67,171
MaskImage HUDImg,0,67,171
MaskImage HUDPlaneImg,0,67,171
MaskImage PlayerDamageImg,0,67,171
MaskImage BulletImg,0,67,171
ResizeImage ShellExplosion,8 * GfxW / 1024,8 * GfxH / 768
ResizeImage LandImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage PlayerImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage EnemyImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage ShipImg,32 * GfxW / 1024,192 * GfxH / 768
ResizeImage CarrierImg,64 * GfxW / 1024,192 * GfxH / 768
ResizeImage ExplosionImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage ShadowImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage CloudI,64 * GfxW / 1024,64 * GfxH / 768
ResizeImage CloudII,96 * GfxW / 1024,96 * GfxH / 768
ResizeImage CloudIII,128 * GfxW / 1024,128 * GfxH / 768
ResizeImage ArrowImg,7 * GfxW / 1024,12 * GfxH / 768
ResizeImage EnemyArrowImg,7 * GfxW / 1024,12 * GfxH / 768
ResizeImage AllyArrowImg,7 * GfxW / 1024,12 * GfxH / 768
ResizeImage EnemyCarrierArrowImg,7 * GfxW / 1024,12 * GfxH / 768
ResizeImage AllyCarrierArrowImg,7 * GfxW / 1024,12 * GfxH / 768
ResizeImage HUDImg,102 * GfxW / 1024,102 * GfxH / 768
ResizeImage HUDPlaneImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage PlayerDamageImg,32 * GfxW / 1024,32 * GfxH / 768
ResizeImage BulletImg,3 * GfxW / 1024,3 * GfxH / 768
SoundVolume Propellor,0.5
SoundVolume PlayerShellSound,0
SoundVolume EnemyShellSound,0
SoundVolume ExplosionSound,1

Dim PlayerAngle(Rotations)
PlayerRotate(Rotations)
Dim EnemyAngle(Rotations)
EnemyRotate(Rotations)
;Dim TurretAngle(Rotations)
;TurretRotate(Rotations)
Dim ShadowAngle(Rotations)
ShadowRotate(Rotations)
Dim HUDPlaneAngle(Rotations)
HUDPlaneRotate(Rotations)

InitiateGame()

Font = LoadFont("Arial",12 * GfxW / 640,0,0,0)
SetFont Font

While Not KeyDown(88)
Cls
UpdateBackground()
UpdateShadows()
UpdateCarriers()
UpdateBullets()
UpdateExplosions()
UpdateEnemys()
UpdatePlayer()
UpdateHUD()
UpdateClouds()
UpdateStats()
UpdateCollisions()
Blah()
Flip
Wend
End

.ExitGame
End

Function UpdatePlayer()
For Player.Player = Each Player
If KeyDown(203) Then Player\A = Player\A - 1
If KeyDown(205) Then Player\A = Player\A + 1
If Player\A >= Rotations Then Player\A = 0
If Player\A < 0 Then Player\A = Rotations - 1
If KeyDown(200)
Player\Z = Player\Z + 0.11
Else
Player\Z = Player\Z - 0.11
EndIf
If KeyDown(208)
Player\Z = Player\Z - 0.5
EndIf
If Player\Z < 2.5 Then Player\Z = 2.5
If Player\Z > 7.5 Then Player\Z = 7.5
Player\X = Player\X + Player\Z * Sin(Player\A * 360 / Rotations) * GfxW / 1024
Player\Y = Player\Y - Player\Z * Cos(Player\A * 360 / Rotations) * GfxH / 768
Player\F = Player\F - (Player\Z/750)
SoundPitch Propellor,1000 * Player\Z + 1
PlaySound Propellor
DrawImage PlayerAngle(Player\A),GfxW / 2,GfxH / 2
If KeyHit(57)
Bullet.Bullet = New Bullet
Bullet\A = Player\A : Bullet\S = 1
Bullet\X = Player\X + GfxW / 2 : Bullet\Y = Player\Y + GfxH / 2
EndIf
Next
End Function

Function UpdateEnemys()
For Enemy.Enemy = Each Enemy

For Player.Player = Each Player
DfX# = (Enemy\X - Player\X) - GfxW / 2 : DfY# = (Enemy\Y - Player\Y) - GfxH / 2
Angle# = ATan2(DfX,-DfY) + 90
Next

If Enemy\A < (Angle + 90)/4 Then Enemy\A = Enemy\A + 1
If Enemy\A > (Angle + 90)/4 Then Enemy\A = Enemy\A - 1
If Enemy\A >= Rotations Then Enemy\A = 0
If Enemy\A < 0 Then Enemy\A = Rotations - 1
If Enemy\Z < 2 Then Enemy\Z = 2
If Enemy\Z > 5 Then Enemy\Z = 5
Enemy\X = Enemy\X + Enemy\Z * Sin(Enemy\A * 360 / Rotations) * GfxW / 1024
Enemy\Y = Enemy\Y - Enemy\Z * Cos(Enemy\A * 360 / Rotations) * GfxH / 768

If MilliSecs() >= Enemy\R + 250
Enemy\R = MilliSecs()
Bullet.Bullet = New Bullet
Bullet\A = Enemy\A : Bullet\S = 2 : Bullet\X = Enemy\X : Bullet\Y = Enemy\Y
For Player.Player = Each Player
Next
EndIf

For Player.Player = Each Player
DrawImage EnemyAngle(Enemy\A),Enemy\X - Player\X,Enemy\Y - Player\Y
Next
Next
End Function

Function UpdateBullets()
For Bullet.Bullet = Each Bullet
Bullet\X = Bullet\X + 10 * Sin(Bullet\A * 360 / Rotations) * GfxW / 1024
Bullet\Y = Bullet\Y - 10 * Cos(Bullet\A * 360 / Rotations) * GfxH / 768
Bullet\L = Bullet\L + 1
For Player.Player = Each Player
DrawImage BulletImg,Bullet\X - Player\X,Bullet\Y - Player\Y
If Bullet\L >= 50
DrawImage ShellExplosion,Bullet\X - Player\X,Bullet\Y - Player\Y
DfX# = (GfxW/2-(Bullet\X-Player\X)) : DfY# = (GfxH/2-(Bullet\Y-Player\Y))
Hyp# = Sqr(DfX^2 + DfY^2) : SHyp# = Sqr((GfxW/2)^2 + (GfxH/2)^2) / 2
If Not Bullet\S = 1 Then SoundVolume EnemyShellSound,1-1/(SHyp/Hyp)
If Not Bullet\S = 1 Then PlaySound EnemyShellSound
If Bullet\S = 1 Then SoundVolume PlayerShellSound,1-1/(SHyp/Hyp)
If Bullet\S = 1 Then PlaySound PlayerShellSound
Delete Bullet
EndIf
Next
Next
End Function

Function PlayerRotate(Degrees)
For Frame = 0 To Degrees
PlayerAngle(Frame) = CopyImage(PlayerImg)
RotateImage PlayerAngle(Frame),Frame * 360 / Degrees
Next
End Function

Function EnemyRotate(Degrees)
For Frame = 0 To Degrees
EnemyAngle(Frame) = CopyImage(EnemyImg)
RotateImage EnemyAngle(Frame),Frame * 360 / Degrees
Next
End Function

Function ShadowRotate(Degrees)
For Frame = 0 To Degrees
ShadowAngle(Frame) = CopyImage(ShadowImg)
RotateImage ShadowAngle(Frame),Frame * 360 / Degrees
Next
End Function

Function HUDPlaneRotate(Degrees)
For Frame = 0 To Degrees
HUDPlaneAngle(Frame) = CopyImage(HUDPlaneImg)
RotateImage HUDPlaneAngle(Frame),Frame * 360 / Degrees
Next
End Function

Function UpdateBackground()
For Player.Player = Each Player
TileImage WaterTile,- Player\X,- Player\Y,0
Next
End Function

Function UpdateShadows()
For Player.Player = Each Player
For Enemy.Enemy = Each Enemy
DrawImage ShadowAngle(Enemy\A),Enemy\X+50*GfxW/1024-Player\X,Enemy\Y+75*GfxH/768-Player\Y
Next
DrawImage ShadowAngle(Player\A),GfxW/2+50*GfxW/1024,GfxH/2+75*GfxH/768
Next
End Function

Function UpdateStats()
For Player.Player = Each Player
DrawImage FuelWord,25,10
WriteNumber(Int(Player\F),55,10)
DrawImage FuelBarHolderImg,105,27
DrawImageRect FuelBarImg,105,27,0,0,2 * Player\F,10
WriteNumber(Int(Player\Z*100),110,43) : DrawImage SpeedWord,155,43
DrawImage AirspeedWord,50,43
;WriteNumber(Player\L,110,60) : DrawImage HeightWord,155,60
;DrawImage AltitudeWord,50,60
;Color 100,75,50 : Rect 5,22,2 * Player\F,10
Next
End Function

Function UpdateHUD()
For Player.Player = Each Player
DrawImage HUDImg,GfxW-61*GfxW/1024,61*GfxH/768
DrawImage HUDPlaneAngle(Player\A),GfxW-61*GfxW/1024,61*GfxH/768
DrawImage PlayerDamageImg,GfxW-134*GfxW/1024,36*GfxH/768,Int(5 - (Player\L/2))
Color 100,100,100
Rect GfxW-161*GfxW/1024,10*GfxH/768,52*GfxW/1024,7*GfxH/768,0
Color 50,50,50
Rect GfxW-160*GfxW/1024,11*GfxH/768,50*GfxW/1024,5*GfxH/768
Color 255-Player\L*25,Player\L*25,0
Rect GfxW-160*GfxW/1024,11*GfxH/768,Player\L*5*GfxW/1024,5*GfxH/768
For Enemy.Enemy = Each Enemy
DfX# = GfxW / 2 - (Enemy\X - Player\X) : DfY# = GfxH / 2 - (Enemy\Y - Player\Y)
Angle# = ATan2(DfX,-DfY) + 90
Pointer = CopyImage(EnemyArrowImg) : RotateImage Pointer,Angle + 90
DrawImage Pointer,GfxW-(61-Cos(Angle)*50)*GfxW/1024,(61+Sin(Angle)*50)*GfxH/768
Next
For Carrier.Carrier = Each Carrier
DfX# = GfxW / 2 - (Carrier\X - Player\X) : DfY# = GfxH / 2 - (Carrier\Y - Player\Y)
Angle# = ATan2(DfX,-DfY) + 90
If Not Carrier\S = 1 Then Pointer = CopyImage(EnemyCarrierArrowImg)
If Carrier\S = 1 Then Pointer = CopyImage(AllyCarrierArrowImg)
RotateImage Pointer,Angle + 90
DrawImage Pointer,GfxW-(61-Cos(Angle)*50)*GfxW/1024,(61+Sin(Angle)*50)*GfxH/768
Next
Next
End Function

Function WriteNumber(Num#,X,Y)
NumStr$ = Num#
For I = 0 To Len(NumStr) - 8
DrawImage Number,X+10*I,Y,Int(Mid(NumStr,I + 1,1))
Next
End Function

Function UpdateClouds()
For Cloud.Cloud = Each Cloud
For Player.Player = Each Player
If Cloud\S = 2 Then DrawImage CloudI,Cloud\X - Player\X,Cloud\Y - Player\Y
If Cloud\S = 3 Then DrawImage CloudII,Cloud\X - Player\X,Cloud\Y - Player\Y
If Cloud\S = 4 Then DrawImage CloudIII,Cloud\X - Player\X,Cloud\Y - Player\Y
Next
Next
End Function

Function UpdateCollisions()
For Player.Player = Each Player
For Bullet.Bullet = Each Bullet

If Not Bullet\S = 1
If ImagesCollide(PlayerAngle(Player\A),GfxW/2,GfxH/2,0,BulletImg,Bullet\X-Player\X,Bullet\Y-Player\Y,0)
Delete Bullet : Player\L = Player\L - 1 : Goto NextBullet
EndIf
EndIf

If Not Bullet\S = 2
For Enemy.Enemy = Each Enemy.Enemy
If ImagesCollide(BulletImg,Bullet\X-Player\X,Bullet\Y-Player\Y,0,EnemyAngle(Enemy\A),Enemy\X-Player\X,Enemy\Y-Player\Y,0)
Delete Bullet : CreateExplosion(Enemy\X,Enemy\Y) : Delete Enemy : Goto NextBullet
EndIf
Next
EndIf

.NextBullet
Next
Next
End Function

Function Blah()
For Player.Player = Each Player
If Player\L < 0 Then InitiateGame()
Next
End Function

Function CreateExplosion(X,Y)
Explosion.Explosion = New Explosion
Explosion\X = X : Explosion\Y = Y
Explosion\F = 0 : PlaySound ExplosionSound
End Function

Function UpdateExplosions()
For Explosion.Explosion = Each Explosion
Explosion\F = Explosion\F + 1
If Explosion\F > 5 Then Delete Explosion : Goto NextExplosion
For Player.Player = Each Player
DrawImage ExplosionImg,Explosion\X - Player\X,Explosion\Y - Player\Y,Explosion\F
Next
.NextExplosion
Next
End Function

Function UpdateCarriers()
For Carrier.Carrier = Each Carrier

If MilliSecs() >= Carrier\R + 5000 And Carrier\P > 0
Carrier\R = MilliSecs() : Carrier\P = Carrier\P - 1
Enemy.Enemy = New Enemy
Enemy\X = Carrier\X : Enemy\Y = Carrier\Y
EndIf


For Player.Player = Each Player
DrawImage CarrierImg,Carrier\X - Player\X,Carrier\Y - Player\Y
WriteNumber(Carrier\P,Carrier\X - Player\X,Carrier\Y - Player\Y)
Next
Next
End Function

Function InitiateGame()
For Player.Player = Each Player
Delete Player
Next
For Enemy.Enemy = Each Enemy
Delete Enemy
Next
For Bullet.Bullet = Each Bullet
Delete Bullet
Next
For Cloud.Cloud = Each Cloud
Delete Cloud
Next
For Carrier.Carrier = Each Carrier
Delete Carrier
Next
Player.Player = New Player
Player\F = 100 : Player\L = 10
Carrier.Carrier = New Carrier
Carrier\X = Rnd(-32*32,32*32)*GfxW/1024 : Carrier\Y = Rnd(-32*32,32*32)*GfxH/768
Carrier\S = 1
Carrier.Carrier = New Carrier
Carrier\X = Rnd(-32*32,32*32)*GfxW/1024 : Carrier\Y = Rnd(-32*32,32*32)*GfxH/768
Carrier\S = 2 : Carrier\P = 10
For I = 1 To 10
Cloud.Cloud = New Cloud
Cloud\X = Rnd(-32*32,32*32)*GfxW/1024 : Cloud\Y = Rnd(-32*32,32*32)*GfxH/768 : Cloud\S = Rnd(2,4)
Next
End Function




[Edited by - Ending_Credits on June 2, 2009 11:04:36 AM]

Share this post


Link to post
Share on other sites
In fact BlitzMax is actually an excellent language for games development. Its cross platform (Mac, Linux and Windows) and the learning curve is not nearly as steep as it is for others.

I know a variety of languages including C#, Java, VB, etc but I still use BlitzMax for games programming. I just got BlitzMax after using Blitz3D for several years. Max has everything you need for games development and a community of contributors that help along the way. It has advanced types (similar to classes) with polymorphism and inheritance allowing for an Object Oriented approach, or you can stick to the procedural paradigm with the advanced data types.

Cheers

Share this post


Link to post
Share on other sites
Quote:

cin isn't part of the C++ language, it's part of the iostream library.

cin is part of the standard library, which is part of the language as defined by the language's ISO specification.

Quote:

One example I ran into was trying to receive input from the user, blitz has no such cin >> statement, and I felt like everything was an uphill struggle.

You believe this, I suspect, because you believe that C++ is somehow indicative of "the way things work." That's not really the case at all; cin is hardly a "core programming technique." C++ provides you a bunch of abstractions just like any other language will -- the same functionality will be achieved in different ways in different languages and different APIs. Try not to approach learning a new language too much from the perspective of the syntax and specifics of another language you know.

Quote:

I have a little experience in programming, I know a little syntax, and the idea behind game loops, classess etc to a basic level. I purchased Blitzmax but I really get the idea that this language is for people who have already spent a few years coding with more traditional languages, and choose Blitz as they can appreciate its time saving mechanics.

There is absolutely nothing wrong or shameful or 'newbie' about using something like BlitzMax. Especially since you've purchased it, you should give yourself some time to use it. What is important to learn as a programmer is how to think like one, and how to think in general, and you can do that with any language and any development environment. Even Game Maker.

Quote:

Would I be better off getting my feet wet with something like Python->pygame? How does pygame present itself to someone who would be new to programming? Or maybe something like C-Allegro?

Python would be a great choice (except, again, you already spent money on this Blitz thing, so give it some time). C would be a less-than-great choice.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this