PacMAN com Harbour
Enviado: 29 Dez 2022 20:02
Olá!
This is a collection of games written in Harbour.
The game is based on the popular game Pac-Man

Fonte parcial.
https://github.com/dev-harbour/hb-games
Saudações,
Itamar M. Lins Jr.
This is a collection of games written in Harbour.
The game is based on the popular game Pac-Man

Fonte parcial.
Código: Selecionar todos
/*
* Copyright 2019 Rafał Jopek ( rafaljopek at hotmail com )
* Copyright 2022 dev-harbour
*/
#include "hbgtinfo.ch"
#include "inkey.ch"
#include "setcurs.ch"
#define BOX_UNI hb_UTF8ToStrBox( "│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌" )
#define CHR_249 hb_UTF8ToStrBox( "·" )
#define CHR_254 hb_UTF8ToStrBox( "■" )
STATIC nRow := 0
STATIC nCol := 0
STATIC cDirection := ""
STATIC nLife := 3
STATIC nRowRed := 0
STATIC nColRed := 0
STATIC cDirectionRed := ""
STATIC aMaze
STATIC aPath
STATIC aPoints
STATIC nStartGame := 0
STATIC nLevel := 1
STATIC nScore := 0
STATIC nColorMaze := 2
STATIC nTop := 0
STATIC nLeft := 0
STATIC nBottom := 0
STATIC nRight := 0
PROCEDURE Main()
Set( _SET_EVENTMASK, hb_bitOr( INKEY_KEYBOARD, HB_INKEY_GTEVENT, INKEY_ALL ) )
SetCursor( SC_NONE )
/* Setup input CP of the translation */
hb_cdpSelect( "UTF8EX" )
hb_gtInfo( HB_GTI_COMPATBUFFER, .F. )
hb_gtInfo( HB_GTI_BOXCP, hb_cdpSelect() )
/* Configure terminal and OS codepage */
hb_SetTermCP( hb_cdpTerm() )
Set( _SET_OSCODEPAGE, hb_cdpOS() )
Set( _SET_DBCODEPAGE, "EN" )
hb_gtInfo( HB_GTI_MAXIMIZED, .T. )
hb_gtInfo( HB_GTI_WINTITLE, "Hb pac man game" )
hb_gtInfo( HB_GTI_RESIZEMODE, HB_GTI_RESIZEMODE_ROWS )
Scroll()
WelcomeScreen()
PacMan()
SetCursor( SC_NORMAL )
RETURN
Saudações,
Itamar M. Lins Jr.