Questions about Clear your mind

Using the Pascal version of SwinGame and you've found a bug? Let us know about it and we will look into it when we get a chance.

Please let us know what operating system you are using, the exact error, when it occurs, etc. the more detail you provide the easier it will be for us to replicate the problem.

Questions about Clear your mind

Postby Running_tape on Thu Apr 14, 2011 8:31 am

I've got two questions about it.

First question. Is there a Windows alternative to Terminal?

Second question. The program does not seem to recognise procecdure LoadGame. Is there some way around that?

Thanks in advance.
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Questions about Clear your mind

Postby acain on Thu Apr 14, 2011 4:16 pm

The terminal is the same as the Command Line in Windows. If you run "cmd" it should open a Command Line (Terminal) window for you.

Not sure about the LoadGame problem. Where is it being called from?
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Questions about Clear your mind

Postby Running_tape on Fri Apr 15, 2011 8:57 am

I'm sure it's called from the MainGame procedure. Do you want to see the code?
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Questions about Clear your mind

Postby acain on Mon Apr 18, 2011 5:01 pm

That would be good, upload the code you are working with and I'll see if I can see the issue.
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Questions about Clear your mind

Postby Running_tape on Fri Apr 22, 2011 6:29 pm

Code: Select all
function CreateSprite(image: Bitmap; framesPerCell, frames, width, height: Integer): Sprite;
procedure MainGame();   
var
   game : GameData;
begin
   repeat
      ProcessEvents();
      RefreshScreen();
   until WindowCloseRequested();
procedure LoadGame(var game: GameData);
   const
   PLAYEROFFSET = 150;
begin
   //Create the player ship
   game.player.theSprite := CreateSprite(GameImage('Ship'), 2, 2, 40, 43);
   game.player.theSprite.xPos := Round(ScreenWidth / 2 - game.player.theSprite.width / 2);
   game.player.theSprite.yPos := ScreenHeight - PLAYEROFFSET;
   game.player.speed := 4;
   end;
end;

procedure Main();
const
   SCREENWIDTH = 480;
   SCREENHEIGHT = 600;
begin
   OpenGraphicsWindow('EmptyYourMind1.1', SCREENWIDTH, SCREENHEIGHT);
   LoadResources();
   MainGame();
   FreeResources();
end;

end.


Sorry for the absence.
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Questions about Clear your mind

Postby acain on Fri Apr 22, 2011 9:32 pm

The problem seems to be that you have declared some functions and procedures within others... try this:
Code: Select all

procedure LoadGame(var game: GameData);
   const
   PLAYEROFFSET = 150;
begin
   //Create the player ship
   game.player.theSprite := CreateSprite(GameImage('Ship'), 2, 2, 40, 43);
   game.player.theSprite.xPos := Round(ScreenWidth / 2 - game.player.theSprite.width / 2);
   game.player.theSprite.yPos := ScreenHeight - PLAYEROFFSET;
   game.player.speed := 4;
end;

procedure MainGame();   
var
   game : GameData;
begin
   LoadGame(game);
   repeat
      ProcessEvents();
      RefreshScreen();
   until WindowCloseRequested();
end;

procedure Main();
const
   SCREENWIDTH = 480;
   SCREENHEIGHT = 600;
begin
   OpenGraphicsWindow('EmptyYourMind1.1', SCREENWIDTH, SCREENHEIGHT);
   LoadResources();
   MainGame();
   FreeResources();
end;

begin
    Main();
end.
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne

Re: Questions about Clear your mind

Postby Running_tape on Sat Apr 23, 2011 7:15 pm

Thanks for your help.

But now a new error has occured.
GameLogic.exe (41,84)Error: Incompatible types: got "Int64" expected "^Single"
GameLogic.exe (42,46)Error: Incompatible types: got "LongInt" expected "^Single"
Running_tape
Journeyman
 
Posts: 11
Joined: Mon Mar 21, 2011 8:49 pm

Re: Questions about Clear your mind

Postby acain on Tue Apr 26, 2011 6:50 pm

Sorry, use "x" rather than "xPos". Same for y...
Cheers,

Andrew Cain
----------
Swinburne University of Technology
Lecturer of Software Development in PSD
User avatar
acain
Site Admin
 
Posts: 252
Joined: Wed Dec 05, 2007 2:35 pm
Location: Swinburne University - Hawthorn - Melbourne


Return to Pascal Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron