BBC BASIC for Windows
« Pac-Man »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:25am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Pac-Man  (Read 1826 times)
Richey
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 35
xx Re: Pac-Man
« Reply #2 on: Aug 13th, 2014, 10:26pm »

Quote:
The program needs the pacmaze.bmp file that you can get from here:

http://alycesrestaurant.com/zips/pacman2.zip


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?
User IP Logged

rtr
Guest
xx 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.
User IP Logged

rtr
Guest
xx 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.
User IP Logged

rtr
Guest
xx 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.
User IP Logged

Richey
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 35
xx 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
:)
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls