Recent

Author Topic: An old-new Pascal user and his questions  (Read 11284 times)

Eugene Loza

  • Hero Member
  • *****
  • Posts: 674
    • My games in Pascal
Re: An old-new Pascal user and his questions
« Reply #15 on: November 23, 2015, 02:48:31 pm »
Have you tried compiling examples again? Sometimes firewall/antivirus messes up with GDB. Another possible problem cause is disabled "Application Experience" service in Windows 7.
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Tomi

  • Full Member
  • ***
  • Posts: 118
Re: An old-new Pascal user and his questions
« Reply #16 on: November 24, 2015, 04:01:52 pm »
Yes! The antivirus! I switched off the Avast on my computer, and the Lazarus finally works! :D I'm so happy; let's go programming! :D
(I don't know, that an antivirus whether really useful software or not, from now on?)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: An old-new Pascal user and his questions
« Reply #17 on: November 24, 2015, 04:48:23 pm »
In general it is wise to exclude all programming related directories from the antivirus.

Even commercial software like Delphi suffers from this.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: An old-new Pascal user and his questions
« Reply #18 on: November 24, 2015, 05:50:41 pm »
Ok, I'm late, and I'm really sad because nobody said a word about Allegro.pas:'(  Last version is full stable, with tons of nice stuff, examples and all that.  And I'll work on version 5 ASAP.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: An old-new Pascal user and his questions
« Reply #19 on: November 24, 2015, 05:58:33 pm »
Ok, I'm late, and I'm really sad because nobody said a word about Allegro.pas:'(  Last version is full stable, with tons of nice stuff, examples and all that.  And I'll work on version 5 ASAP.
I didn't mean to, sorry :-[
*waiting for author of SDL wrapper to say the same thing*

Tomi

  • Full Member
  • ***
  • Posts: 118
Re: An old-new Pascal user and his questions
« Reply #20 on: November 24, 2015, 07:00:54 pm »
In general it is wise to exclude all programming related directories from the antivirus.

Even commercial software like Delphi suffers from this.

OK, now I'm learned, that the antiviruses are damned funny... >:D
But are they causing problems not only for Lazarus and FP, but for created programs too?

Tomi

  • Full Member
  • ***
  • Posts: 118
Re: An old-new Pascal user and his questions
« Reply #21 on: November 24, 2015, 07:12:53 pm »
Ok, I'm late, and I'm really sad because nobody said a word about Allegro.pas:'(  Last version is full stable, with tons of nice stuff, examples and all that.  And I'll work on version 5 ASAP.

Oh, I didn't know the Allegro.pas! But I visited its website just now, and I download it and play with the "Allegator" demo - really funny :D
How can I use it? When I try running it's setup.exe, it just informing me, that the aleg44.dll is not installed properly (I see, it's beside the demo game.) :-[

Eugene Loza

  • Hero Member
  • *****
  • Posts: 674
    • My games in Pascal
Re: An old-new Pascal user and his questions
« Reply #22 on: November 24, 2015, 08:04:51 pm »
Quote
and I'm really sad because nobody said a word about Allegro.pas.
Wow! I should try this some day! I have a few games from those ancient times left :) Now they run under DOSbox, but if I can make them 'normal' that would be fantastic :).
Quote
In general it is wise to exclude all programming related directories from the antivirus.
I tried to myself. But ended up completely removing Comodo firewall. If it starts to mess the things up, then a simple exclusion of Gdb or something else doesn't help. And too much time is spent on scanning forums and FAQs... Linux forever!!!
My FOSS games in FreePascal&CastleGameEngine: https://decoherence.itch.io/ (Sources: https://gitlab.com/EugeneLoza)

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: An old-new Pascal user and his questions
« Reply #23 on: November 24, 2015, 08:24:02 pm »
But are they causing problems not only for Lazarus and FP, but for created programs too?
Sure. Anything where malwares may hide will be antivirus targets. Exes for sure, but M$ docs (doc, xls, ppt) and even JPEG images, too!

Tomi

  • Full Member
  • ***
  • Posts: 118
Re: An old-new Pascal user and his questions
« Reply #24 on: November 26, 2015, 05:39:42 pm »
It's me, again. I would like make a snake-like game (the players can draws pixel-streaks), but something wrong with it's basis, maybe at the readkey piece of code(?); the pixel are not moving when I press a key.
Here is the code:
Code: Pascal  [Select][+][-]
  1. program game;
  2. uses crt,graph;
  3. type players=record
  4.         xplace,yplace: integer;
  5.         itscolor: byte;
  6. end;
  7. var gd,gm: integer;
  8.     c: char;
  9.     i: byte;
  10.     player: array[0..1] of players;
  11. begin
  12.         gd:=detect;
  13.         gm:=0;
  14.         initgraph(gd,gm,'');
  15.         player[0].xplace:=5;
  16.         player[0].yplace:=5;
  17.         player[0].itscolor:=5;
  18.         player[1].xplace:=getmaxx-5;
  19.         player[1].yplace:=5;
  20.         player[1].itscolor:=10;
  21.         for i:=0 to 1 do
  22.                 putpixel(player[i].xplace,player[i].yplace,player[i].itscolor);
  23.         repeat
  24.                 if keypressed then c:=readkey;
  25.                 case c of
  26.                  'w': player[0].yplace:=player[0].yplace-1;
  27.                  's': player[0].yplace:=player[0].yplace+1;
  28.                  'a': player[0].xplace:=player[0].xplace-1;
  29.                  'd': player[0].xplace:=player[0].xplace+1;
  30.                 end;
  31.          for i:=0 to 1 do
  32.                 putpixel(player[i].xplace,player[i].yplace,player[i].itscolor);
  33.         until c=#27;
  34.         closegraph;
  35. end.
Somebody can help me? :-[
« Last Edit: November 26, 2015, 05:43:51 pm by Tomi »

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: An old-new Pascal user and his questions
« Reply #25 on: November 26, 2015, 06:12:29 pm »
I didn't mean to, sorry :-[
*waiting for author of SDL wrapper to say the same thing*
Ok, don't worry. I didn't cry so much.

And yes, I'm waiting for author of SDL too... ::)

How can I use it? When I try running it's setup.exe, it just informing me, that the aleg44.dll is not installed properly (I see, it's beside the demo game.) :-[
setup.exe is a program to create and modify the allegro.cfg configuration file.

alleg44.dll should be in the system directory (C:\windows\system32\ IIRC), or in the same directory than the executable.

Then, the  "lib" directory (with those *.pas *.inc and *.cfg files) should be accessible to the compiler.  The README file explains on way, but you can copy the directory to the compiler's "unit" subdirectory.  This last one depends on the version and the configuration you're using.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1228
Re: An old-new Pascal user and his questions
« Reply #26 on: November 26, 2015, 11:30:01 pm »
hello,
for a  pascal snake game in console mode look at here
this game uses textcolor and for the loop :
Code: Pascal  [Select][+][-]
  1.       Repeat
  2.     KeyScan;
  3.  
  4.       BEGIN
  5.         clrscr;
  6.         border;
  7.         VarSet;
  8.         textcolor(white);
  9.         gotoxy(35,1);
  10.         write('Direction: ',char(24));
  11.         Obj;
  12.         While true do
  13.           BEGIN
  14.             PutSnakeVars;
  15.             KeyScan;
  16.             If DX = -X0 then X0 := DX;
  17.             If DY = -Y0 then Y0 := DY;
  18.             HX := X[1] + X0;
  19.             HY := Y[1] + Y0;
  20.             If CheckObj then
  21.               BEGIN
  22.                 Inc (SC);
  23.                 if SC >= 5  then MoveDelay:=100;
  24.                 if SC >= 10 then MoveDelay:=75;
  25.                 if SC >= 15 then MoveDelay:=50;
  26.                 if SC >= 20 then MoveDelay:=25;
  27.                 Fat;
  28.                 Obj;
  29.               END;
  30.             If CheckRun then Goto L2;
  31.             Move;
  32.             If CheckEat then Goto L2;
  33.             If EXIT then Goto L2;
  34.             Delay (MoveDelay);
  35.           END;
  36. L2:END
  37.   Until EXIT;
  38.  
friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

 

TinyPortal © 2005-2018