Author |
Topic: Pac-Man (Read 1826 times) |
|
Richey
New Member
member is offline


Gender: 
Posts: 35
|
 |
Re: Pac-Man
« Reply #2 on: Aug 13th, 2014, 10:26pm » |
|
Quote:
Thanks Richard...very useful to be able to review and modify the source code in order to aid learning. One dumb question first though - I have the pacmaze.bmp but how do I get it to link to the program?
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: Pac-Man
« Reply #3 on: Aug 14th, 2014, 08:30am » |
|
on Aug 13th, 2014, 9:05pm, David Williams wrote:| It works at this end, and I'm pleased to say that the flickering didn't induce an epileptic seizure with me. |
|
There's no flickering on the (two) machines I've tried it on, but in the absence of *REFRESH (which I had originally, but removed as it seemed to be unnecessary) it relies on a prompt response to the internal InvalidateRect calls. Windows gives no guarantees about that, and it depends very much on what else is going on.
Richard.
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: Pac-Man
« Reply #4 on: Aug 14th, 2014, 08:39am » |
|
on Aug 13th, 2014, 10:26pm, Richey wrote:| I have the pacmaze.bmp but how do I get it to link to the program? |
|
Save it to the same folder as the program. That will usually work, but it does depend on the 'current directory' being the same as the 'program directory'. In the unlikely event of that not being the case (for example if you compile the program and run it from a shortcut) change the *DISPLAY line to:
Code: OSCLI "DISPLAY """ + @dir$ + "pacmaze"" 960,-238" Richard.
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
Re: Pac-Man
« Reply #5 on: Aug 14th, 2014, 11:33am » |
|
on Aug 14th, 2014, 08:30am, Richard Russell wrote:| *REFRESH (which I had originally, but removed as it seemed to be unnecessary) |
|
If you find that flickering is an issue you should be able to eliminate it by restoring the *REFRESH:
Code: REPEAT
WAIT 10
CASE INKEY(0) OF
WHEN 136: newdir = 1 : try = TRUE
WHEN 139: newdir = 2 : try = TRUE
WHEN 137: newdir = 3 : try = TRUE
WHEN 138: newdir = 4 : try = TRUE
ENDCASE
PROCdot
PROCmovePacman
*REFRESH OFF
PROCbackground
PROCghost(0)
PROCghost(1)
PROCghost(2)
PROCghost(3)
PROCdrawPacman
*REFRESH ON
*REFRESH
PROCdetectGhost
IF dotcount = 254 THEN dotcount = 0 : PROCwin
IF dead = 1 THEN dead = 0 : PROCdie
IF done = 1 THEN PROCgameover
UNTIL FALSE Richard.
|
|
Logged
|
|
|
|
Richey
New Member
member is offline


Gender: 
Posts: 35
|
 |
Re: Pac-Man
« Reply #6 on: Aug 14th, 2014, 8:53pm » |
|
on Aug 14th, 2014, 08:39am, Richard Russell wrote:Save it to the same folder as the program. That will usually work, but it does depend on the 'current directory' being the same as the 'program directory'. In the unlikely event of that not being the case (for example if you compile the program and run it from a shortcut) change the *DISPLAY line to:
Code: OSCLI "DISPLAY """ + @dir$ + "pacmaze"" 960,-238" Richard. |
|
Thanks Richard - it worked saving it to the same folder - and no flicker for me :)
|
|
Logged
|
|
|
|
|