Coding problems.

Forum Archive - from http://theuniversal.net
Locked
User avatar
Mattizme
Posts: 615
Joined: Sat Oct 04, 2003 6:23 pm
Location: At work/school/home
Contact:

Coding problems.

Post by Mattizme »

Mit,

Please explain to me what's going wrong in here.

I've just include the Tractor Land game, I have all the functions needed, I think I've done everything correctly here, but if I hit F2 to try and go to the game it just sits on the select screen. If I then hit F1, it will go to the Invaders game and play just fine. What have I forgotten?

Code: Select all

#include <StandardDef.h>
#include <Arcade.h>

#include "Invaders\Invaders.h"
#include "TracLand\TracLand.h"
#include "Arcade Data.h"

#define		NUM_GAMES_AVAILABLE		2

char*	mszArcadeGameNames[NUM_GAMES_AVAILABLE] = 
{
	"Invaders",
	"Tractor Land",

//    "Your new game name"
};

ARCADE_GAME_FUNCTION_TABLE	maxArcadeFunctionTable[NUM_GAMES_AVAILABLE] = 
{
	//	Update Function,	Free function,		Init function,		Keypress functions
	{	InvadersUpdate, InvadersFreeGraphics, InvadersInitGraphics, InvadersKeyDown, InvadersKeyUp	},
	{	LandUpdate, LandFreeGraphics, LandInitGraphics, LandKeyDown, LandKeyUp						},

//	{	YourNewUpdateFunction, YourNewFreeGraphics, YourNewInitGraphics, YourNewKeyDown, YourNewKeyUp },
};
User avatar
Mit
Staff
Staff
Posts: 3551
Joined: Sun Sep 21, 2003 10:14 pm
Location: Unknown

Post by Mit »

Most likely jus a wee bug in the arcade sys.. never tried it with more than 1 game that i remember so prolly jus forgot to connect the other keys. Will post a full update of the interface and arcade libs with the fix in in the next couple of days.
User avatar
Mattizme
Posts: 615
Joined: Sat Oct 04, 2003 6:23 pm
Location: At work/school/home
Contact:

Post by Mattizme »

Cheers mate, sounds spiffy..

Just a question though, what happens when we get above 12 games? :)
User avatar
Knoxjoey
Posts: 98
Joined: Tue Sep 30, 2003 8:52 pm
Location: Canada
Contact:

yey

Post by Knoxjoey »

thnx mit ! i'd like too get some of this updated code ;p
User avatar
Mattizme
Posts: 615
Joined: Sat Oct 04, 2003 6:23 pm
Location: At work/school/home
Contact:

Post by Mattizme »

Please Note that until Mit fixes this, you can just as easily comment out the 'Tractor Invaders' game and swap in your new own one :)

*pokes Mit to get him to make the fix*
User avatar
DeVice
Staff
Staff
Posts: 215
Joined: Fri Oct 10, 2003 9:12 pm
Location: I wish i knew...
Contact:

Post by DeVice »

If Mit tell me what he usually sends you, i would be happy to code the changes needed, as i'm also planning to add an arcade game myself.
darealnash
Posts: 7
Joined: Fri Apr 09, 2004 3:16 pm

Post by darealnash »

I`ve got a problem too. I have a source code:
//This is my first program with if statements
#include <iostream.h>
int main()
{
int age,goodbye;
cout<<"Please enter your age";
cin>>age;
if (age==12)
{
cout<<"You are the same age as me!";
}
else if (age<12)
{
cout<<"You are younger than i am";
}
else if (age>12)
{
cout<<"You are older than i am";
}
cin>>goodbye;
return 0
}
I use Borland C++BuilderX and when I try to run the program it says Error: Unresolved external 'WinMain' referenced from C:\CBUILDERX\LIB\C0W32.OBJ
Am I doing something wrong here?
Locked