亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? shared functions.bb

?? A STAR 算法源碼, 比較初級的算法, 適合初學的朋友研究
?? BB
字號:
;Common Functions
;==================================================================
;This include file contains functions that are used by several demos. It does not contain
;any significant pathfinding-related code.

Global gInt1, gInt2
Const failed = -1, succeeded = 1
Global gScreenCaptureNumber, gLoops, gLoopTime#, gGameTime#

;Returns the lesser of two numbers.
Function Min#(a#,b#)
	If a < b Then Return a
	Return b
End Function

;Returns the greater of two numbers.
Function Max#(a#,b#)
	If a > b Then Return a
	Return b
End Function

;Returns the angle between the first point and the second point.
;Zero degrees is at the 3 o'clock position. Angles proceed in a
;counterclockwise direction. For example, 90 degrees is at
;12 o'clock. 180 degrees is at 9 o'clock, and 270 degrees
;is at 6 o'clock.
;	Also, please note that this function is using screen coordinates,
;where y increases in value as it goes down.
;	Note that the Blitz ATan2() function returns -180 to 180 with
;zero being the 12 o'clock position if y increases as you move up
;the screen, and 6'oclock if y increases as you move down the screen.
;This functions adjusts for that.
Function GetAngle(x1#,y1#,x2#,y2#)
	angle = ATan2(x2-x1,y2-y1)
	If angle >= 90 And angle <= 180
		Return angle-90
	Else
		Return angle+270			
	End If
End Function

;Note: Blitz calculates squares very slowly for some reason,
;so it is much faster to multiply the values rather than using
;the shorthand "^2".
Function GetDistance#(x1#,y1#,x2#,y2#)
	Return Sqr( (x1#-x2#)*(x1#-x2#) + (y1#-y2#)*(y1#-y2#) )	
End Function

;This subroutine copies the map image into one large image for
;faster rendering. This isn't really necessary, and it doesn't effect
;pathfinding at all. It just makes map drawing faster because drawing
;one big image is a lot faster than separately drawing each of the wall
;images and grids. 
Function CopyMapImage()
	FreeImage gMap
	gMap = CreateImage(800,600) ;create a new map image.
	SetBuffer ImageBuffer(gMap)
	For x = 0 To 800/tileSize-1
	For y = 0 To 600/tileSize-1
		If walkability(x,y) = unwalkable Then DrawBlock wallBlock,x*tileSize,y*tileSize
		DrawImage grid,x*tileSize,y*tileSize			
	Next
	Next		
	SetBuffer BackBuffer()
End Function

;This function draws the blue walls and grid.
Function DrawMapImage()
	If gGameStarted = False	
		Cls
		For x = 0 To 800/tileSize-1
		For y = 0 To 600/tileSize-1
			If walkability(x,y) = unwalkable Then DrawBlock wallBlock,x*tileSize,y*tileSize
			DrawImage grid,x*tileSize,y*tileSize			
		Next
		Next
	Else
		DrawBlock gMap,0,0
	End If
End Function	

;This function loads walkability data from a file.
Function LoadMapData(fileName$)
	filein = ReadFile(fileName$)
	If filein
		For x = 0 To 800/tileSize-1
		For y = 0 To 600/tileSize-1
			walkability(x,y) = ReadByte(filein)			
		Next
		Next	 
		CloseFile(filein)	
	End If
End Function	

;This function saves walkability data to a file.
Function SaveMapData(fileName$)
	fileout = WriteFile(fileName$)	
	For x = 0 To 800/tileSize-1
	For y = 0 To 600/tileSize-1
		If walkability(x,y) <> 1Then WriteByte(fileout,0)
		If walkability(x,y) = 1 Then WriteByte(fileout,walkability(x,y))					
	Next
	Next
	CloseFile(fileout)	
End Function

;ScreenCapture by pressing print screen or F12. Successive screen
;captures during the same program run will be saved separately.
Function ScreenCapture()
	If KeyHit(88) Or KeyHit(183)
		SaveBuffer(BackBuffer(),"screenshot"+gScreenCaptureNumber+".bmp")
		gScreenCaptureNumber = gScreenCaptureNumber+1 ;global enables multiple captures
	EndIf	
End Function

;This function draws unit claimed nodes. It is called by the 
;RenderScreen() function.
Function DrawClaimedNodes(drawSelectedOnly=False)
	If gDrawMore = True	
		For x = 0 To 800/tileSize-1
		For y = 0 To 600/tileSize-1
			If claimedNode(x,y) <> Null;claimed nodes
				unit.unit = claimedNode(x,y)
				If drawSelectedOnly=False Or unit\ID <= 3			
					If unit\pathStatus <> stopped
						Color unit\red,unit\green,unit\blue
						Rect x*tileSize+.4*tileSize,y*tileSize+.4*tileSize,.2*tileSize,.2*tileSize,1	
					End If
				End If	
			End If
		Next
		Next	
		For unit.unit = Each unit ;draw square when unit is tempStopped
			If drawSelectedOnly=False Or unit\ID <= 3			
			If unit\pathStatus = tempStopped
				Color unit\red,unit\green,unit\blue
				Rect ReadPathX(unit,unit\pathLocation)-.25*tileSize,ReadPathY(unit,unit\pathLocation)-.25*tileSize,.5*tileSize,.5*tileSize,0
			End If
			End If
		Next		
	End If
End Function


;This function calculates the average amount time that has passed
;per loop over the past 20 game loops. This rolling average
;is combined with speed information (expressed in pixels/second) to
;determine how far to move a unit in a given loop. 
;	We use this time-based approach to ensure consistent unit 
;movement speeds. If units instead moved a fixed distance every 
;loop, the movement speed would be inconsistent from one PC
;to the next because of different chip speeds and monitor refresh
;rates.
;	A rolling average is used because the Millisecs() function does
;not always return a reliably accurate time down to the millisecond. 
;Using an average over the past 20 game loops is more reliable.
Dim savedClockTime#(20)
Global savedClockCount
Function UpdateGameClock()
	savedClockCount = savedClockCount+1
	If savedClockCount = 20 Then savedClockCount = 0
	time# = MilliSecs()
	gLoopTime# = (time#-savedClockTime#(savedClockCount))/20000	
	savedClockTime#(savedClockCount) = time#
	If gLoopTime# > .1 Then gLoopTime# = .0167	
End Function

	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产综合久久精品图片| 久久国产精品99久久久久久老狼| 成人黄色av电影| 欧美国产精品一区二区| 国产福利精品导航| ...xxx性欧美| 欧洲精品视频在线观看| 丝袜美腿成人在线| 精品久久久久久最新网址| 国产精品一区二区视频| 国产精品看片你懂得| 91久久精品一区二区| 五月天丁香久久| 日韩欧美的一区| 国产成都精品91一区二区三| 国产精品无遮挡| 欧美性一二三区| 老司机精品视频在线| 国产欧美精品一区二区色综合| 99国产精品久久久久久久久久久| 亚洲一二三专区| 精品国产sm最大网站| 不卡在线观看av| 午夜日韩在线电影| 久久综合久久综合久久| 97久久精品人人爽人人爽蜜臀| 天天操天天干天天综合网| 精品国产电影一区二区| 97久久久精品综合88久久| 日韩电影在线免费| 中文字幕欧美日本乱码一线二线| 欧美又粗又大又爽| 国产一区视频网站| 亚洲另类一区二区| 2017欧美狠狠色| 色婷婷综合久久久久中文一区二区 | 国产精品久久久久久久久搜平片| 色婷婷亚洲精品| 国产精品主播直播| 午夜视黄欧洲亚洲| 国产精品女人毛片| 欧美一区二区三区人| 99精品久久99久久久久| 精品一区二区在线看| 亚洲国产日韩精品| 中文字幕av免费专区久久| 欧美精品一二三| 91丨porny丨首页| 狠狠色狠狠色综合系列| 亚洲成人一区二区在线观看| 国产欧美精品一区二区色综合朱莉 | 蜜桃av噜噜一区二区三区小说| 欧美国产精品专区| 日韩欧美123| 欧美日韩一区在线| 91一区二区在线| 国产成人一区二区精品非洲| 天天av天天翘天天综合网 | 综合自拍亚洲综合图不卡区| 日韩欧美一区中文| 欧美丝袜丝交足nylons| 99综合影院在线| 国产suv精品一区二区三区| 麻豆成人久久精品二区三区红| 夜夜夜精品看看| 亚洲视频你懂的| 国产精品美女视频| 国产丝袜美腿一区二区三区| 欧美成人一级视频| 欧美一区午夜精品| 国产一区二区成人久久免费影院| 精品夜夜嗨av一区二区三区| 亚洲一二三区在线观看| 亚洲欧美日韩久久精品| ㊣最新国产の精品bt伙计久久| 久久午夜羞羞影院免费观看| 精品国产精品网麻豆系列 | 欧美色网站导航| 欧美优质美女网站| 欧美日韩国产综合一区二区三区 | 丁香激情综合国产| 国产91色综合久久免费分享| 国产酒店精品激情| 国产成人a级片| 国产不卡在线播放| jlzzjlzz欧美大全| 色综合天天做天天爱| 91丨国产丨九色丨pron| 欧美中文字幕亚洲一区二区va在线| 一本到高清视频免费精品| 91国产视频在线观看| 欧美性猛交一区二区三区精品| 欧美日韩在线播放| 日韩免费看的电影| 国产亚洲成aⅴ人片在线观看 | 精品久久国产97色综合| 久久久久久久久久看片| 国产精品免费观看视频| 日韩理论片一区二区| 亚洲福利视频导航| 久久精品国产999大香线蕉| 国产一区二区在线视频| 91色视频在线| 欧美久久免费观看| 2023国产精品| 亚洲人成小说网站色在线| 亚洲一二三四区| 免费在线看一区| 成人午夜视频免费看| 色94色欧美sute亚洲线路一久| 一本色道久久加勒比精品 | 久久精品亚洲精品国产欧美 | 欧美日韩免费高清一区色橹橹| 7777精品伊人久久久大香线蕉的| 精品999在线播放| 亚洲精品菠萝久久久久久久| 日韩精品一二区| 国产成人av福利| 正在播放亚洲一区| 国产精品丝袜在线| 亚洲高清不卡在线观看| 国产精品夜夜嗨| 8x8x8国产精品| 国产精品美女久久久久aⅴ国产馆| 亚洲最新视频在线播放| 精品影视av免费| 在线免费观看日韩欧美| 国产亚洲精久久久久久| 午夜一区二区三区视频| 国产91露脸合集magnet| 欧美人xxxx| 最新国产成人在线观看| 免费在线观看成人| 色8久久精品久久久久久蜜| 精品久久久久久久一区二区蜜臀| 一区二区三区色| 国产不卡视频一区二区三区| 69堂亚洲精品首页| 一级精品视频在线观看宜春院| 国产一区视频导航| 欧美一区二区精品久久911| 亚洲日本在线观看| 国产成人一区二区精品非洲| 日韩欧美专区在线| 夜夜嗨av一区二区三区| www.在线成人| 国产三级精品视频| 久久国产夜色精品鲁鲁99| 精品视频一区二区三区免费| 国产精品久久久久三级| 国产精品羞羞答答xxdd| 欧美不卡激情三级在线观看| 亚洲午夜激情网页| 欧美在线小视频| 亚洲日本成人在线观看| 成人ar影院免费观看视频| 精品国产乱码久久久久久久久| 日本不卡123| 91麻豆精品国产自产在线观看一区 | 九九视频精品免费| 欧美一区国产二区| 亚洲a一区二区| 欧美日韩一区二区在线观看 | 欧美mv日韩mv| 七七婷婷婷婷精品国产| 欧美猛男gaygay网站| 亚洲成人资源网| 8x8x8国产精品| 蜜桃视频免费观看一区| 51精品秘密在线观看| 视频一区二区中文字幕| 欧美日韩国产免费| 日本欧美肥老太交大片| 91精品国产91久久久久久最新毛片 | 丝袜亚洲另类欧美| 欧美丰满高潮xxxx喷水动漫| 视频一区二区不卡| 欧美大片顶级少妇| 国产精品综合视频| 欧美国产一区在线| 色综合咪咪久久| 亚洲一区二区三区四区五区黄| 欧美日韩国产综合久久| 日韩精品电影一区亚洲| 日韩欧美国产1| 粉嫩13p一区二区三区| 中文字幕佐山爱一区二区免费| 欧美亚洲综合久久| 免费在线成人网| 国产性色一区二区| 色婷婷亚洲综合| 免费成人在线观看视频| 国产丝袜在线精品| 色丁香久综合在线久综合在线观看| 夜夜嗨av一区二区三区网页 | 欧美日韩一区二区电影| 日韩在线一区二区三区| 国产色产综合色产在线视频| 99精品热视频| 日韩—二三区免费观看av|