Neural network and my artificial intelligence
automated a similar game day before
https://staging.qb64phoenix.com/showthre...3#pid14613
plus it looks like XONIX
https://staging.qb64phoenix.com/showthread.php?tid=519
milli gif 35 kB in my automatic neuronet algorithm
automated a similar game day before
https://staging.qb64phoenix.com/showthre...3#pid14613
plus it looks like XONIX
https://staging.qb64phoenix.com/showthread.php?tid=519
Code: (Select All)
_Title "Basic Chase and Prize.bas Game" ' b+ 2023-03-24
Randomize Timer
Screen _NewImage(640, 480, 32) '80 cols X 30 rows
_ScreenMove 250, 100
Locate 7, 20: Print "*** Basic Chase and Prize Game ***"
Locate 10, 20: Print "H = Hero"
Locate 12, 20: Print "* = Prize"
Locate 14, 20: Print "X = Doom!"
Locate 18, 20: Print "Object: Use NumberPad to Collect prizes,"
Locate 19, 28: Print "don't let Doom come to Hero!"
Locate 25, 20: Print "press any to start...."
Sleep
DoomMoves = 20
HeroX = 40: HeroY = 15
PrizeX = Int(Rnd * 78) + 2: PrizeY = Int(Rnd * 28) + 2
DoomX = Int(Rnd * 78) + 2: DoomY = Int(Rnd * 28) + 2
Do
Cls ' screen update
Locate HeroY, HeroX: Print "H";
Locate PrizeY, PrizeX: Print "*";
Locate DoomY, DoomX: Print "X";
If HeroX = PrizeX And HeroY = PrizeY Then
score = score + 1
PrizeX = Int(Rnd * 78) + 2: PrizeY = Int(Rnd * 28) + 2
DoomX = Int(Rnd * 78) + 2: DoomY = Int(Rnd * 28) + 2
If DoomMoves > 5 Then DoomMoves = DoomMoves - 1
ElseIf HeroX = DoomX And HeroY = DoomY Then
Locate 15, 35: Print "Game Over"
Beep: _Delay 8: _KeyClear: Sleep: Exit Do
End If
_Title "Prizes:" + Str$(score)
' Danilin
oy = HeroY:: ox = HeroX
Locate 1, 1: Print oy, ox
Locate oy, ox: Print " ";
If HeroY < PrizeY Then ox = HeroX: oy = HeroY: HeroY = HeroY + 1
Locate HeroY, HeroX: Print "R";
Locate oy, ox: Print " ";
If HeroY > PrizeY Then ox = HeroX: oy = HeroY: HeroY = HeroY - 1
Locate HeroY, HeroX: Print "R";
Locate oy, ox: Print " ";
If HeroX < PrizeX Then ox = HeroX: oy = HeroY: HeroX = HeroX + 1
Locate HeroY, HeroX: Print "R";
Locate oy, ox: Print " ";
If HeroX > PrizeX Then ox = HeroX: oy = HeroY: HeroX = HeroX - 1
Locate HeroY, HeroX: Print "R";
Locate oy, ox: Print " ";
If (HeroY = DoomY And HeroY < 22) Then ox=HeroX: oy=HeroY: HeroY = HeroY+(Int2*Rnd-1.5))
Locate HeroY, HeroX: Print "R";
Locate oy, ox: Print " ";
If (HeroX = DoomX And HeroY < 72) Then ox=HeroX: oy=HeroY: HeroX = HeroX+(Int(2*Rnd-1.5))
Locate HeroY, HeroX: Print "R";
' Danilin
testX = HeroX + dx: testY = HeroY + dy
If testX > 0 And testX < 81 And testY > 0 And testY < 31 Then
HeroX = testX: HeroY = testY
Else
Beep
End If
lc = lc + 1
If lc = DoomMoves Then
DoomX = DoomX + Sgn(HeroX - DoomX): DoomY = DoomY + Sgn(HeroY - DoomY)
lc = 0
End If
_Limit 30
Loop Until _KeyDown(27)
milli gif 35 kB in my automatic neuronet algorithm
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic
Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself