freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于vc的俄羅斯方塊(編輯修改稿)

2025-07-24 19:08 本頁面
 

【文章內(nèi)容簡介】 s + getStringHeight(textToDisplay)。 textToDisplay := 39。Press any key39。 textXPos := (screenWidth getStringWidth(textToDisplay)) div 2。 drawText(textToDisplay, textXPos, textYPos)。 repaint。 { wait until user presses any key } repeat keyCode := getKeyClicked。 12創(chuàng)業(yè)創(chuàng)新 知識管理Ahead Institute of software and Technology until keyCode 0。end。{ gameOver displays the game over screen}function gameOver: boolean。var textToDisplay : string。 textXPos : integer。 textYPos : integer。 keyCode : integer。newGame : mand。 quit : mand。 clickedCommand: mand。begin setColor(255, 255, 255)。 fillRect(0, 0, screenWidth, screenHeight)。 setColor(255, 0, 0)。 setFont(FONT_FACE_PROPORTIONAL, FONT_STYLE_BOLD, FONT_SIZE_LARGE)。 textToDisplay := 39。Game over!39。 textXPos := (screenWidth getStringWidth(textToDisplay)) div 2。 textYPos := (screenHeight getStringHeight(textToDisplay)) / 2。 drawText(textToDisplay, textXPos, textYPos)。 textYPos := textYPos + getStringHeight(textToDisplay)。 repaint。 newGame := createCommand(39。Play39。, CM_SCREEN, 1)。quit := createCommand(39。Quit39。, CM_EXIT, 1)。addCommand(newGame)。addCommand(quit)。 { wait until user presses any key }13創(chuàng)業(yè)創(chuàng)新 知識管理Ahead Institute of software and Technology repeat delay(100)。 clickedCommand := getClickedCommand。 until (clickedCommand emptyCommand)。 if clickedCommand = quit thengameOver := true。elsegameOver := false。removeCommand(newGame)。removeCommand(quit)。end。{setSizes calculates the size of a single blockand the position of the game field}procedure setSizes。var blockWidth, blockHeight: integer。beginscreenWidth := getWidth。screenHeight := getHeight。blockWidth := screenWidth / fieldWidth。blockHeight := screenHeight / fieldHeight。if blockHeight blockWidth then blockSize := blockWidth。elseblockSize := blockHeight。screenX := (screenWidth blockSize*fieldWidth) / 2。screenY := (screenHeight blockSize*fieldHeight) / 2。end。14創(chuàng)業(yè)創(chuàng)新 知識管理Ahead Institute of software and Technology{initializeGameField makes the game field empty}procedure initializeGameField。var i, j:integer。beginfor i:=1 to fieldWidth dofor j:=1 to fieldHeight dogameField[i, j] := 0。end。{drawScore writes the score on the screen in black}procedure drawScore。var stringWidth, stringHeight: integer。outputText: string。beginoutputText := 39。Lines: 39。 + score。stringWidth := getStringWidth(outputText)。stringHeight := getStringHeight(outputText)。setFont(FONT_FACE_PROPORTIONAL, FONT_STYLE_PLAIN, FONT_SIZE_SMALL)。setColor(0, 0, 0)。drawText(outputText, (screenWidth stringWidth) / 2, (screenHeight stringHeight) / 2)。end。{drawBlock draws a single game block}procedure drawBlock(col, row, color: integer)。var red, green, blue: integer。begin{ set the color }15創(chuàng)業(yè)創(chuàng)新 知識管理Ahead Institute of software and Technologyif color = 1 then red := 255。if color = 2 then green := 255。if color = 3 then blue := 255。if color = 4 then begin red := 255。 green := 255。 end。if color = 5 then begin red := 255。 blue := 255。 end。if color = 6 then begin green := 255。 blue := 255。 end。if (color 0) and (row 0) and (row = fieldHeight) and (col 0) and (col = fieldWidth) thenbeginrow := row。col := col 1。{ draw the light block fill }setColor(red, green, blue)。fillRect(screenX + col*blockSize, screenHeight screenY row*blockSize, blockSize, blockSize)。{ draw the dark border around the block }setColor(red/2, green/2, blue/2)。drawRect(screenX + col*blockSize, screenHeight screenY row*blockSize, blockSize, blockSize)。end。end。{redrawGameScreen redraws the screen with all the blocks }procedure redrawGameScreen。var i, j: integer。beginsetColor(0, 0, 0)。fillRect(0, 0, screenWidth, screenHeight)。setColor(255, 255, 255)。fillRect(screenX, screenY, fieldWidth * blockSize + 1, fieldHeight * blockSize + 1)。{ draw the blocks that are down }16創(chuàng)業(yè)創(chuàng)新 知識管理Ahead Institute of software and Technologyfor i:=1 to fieldWidth dofor j:=1 to fieldHeight dodrawBlock(i, j, gameField[i, j])。{ draw the blocks that are falling }for i:=1 to 4 dofor j:=1 to 4 dodrawBlock(i + blockX, j + blockY, block[i, j])。{ draw the score text }drawScore。repaint。end。{createNewBlock creates the new falling block. If you wantto change the falling shapes, do it here.}procedure createNewBlock。var x, shape: integer。beginshape := random(7)。x := random(6) + 1。if shape = 0 thenbeginblock[1, 4] := 0。 block[2, 4] := x。 block[3, 4] := x。 block [4, 4] := 0。block[1, 3] := 0。 block[2, 3] := x。 block[3, 3] := x。 block [4, 3] := 0。block[1, 2] := 0。 block[2, 2] := 0。 block[3, 2] := 0
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1