|
Post by plus on Aug 3, 2024 19:36:53 GMT
EDIT: rats the forum paged on us... You needed J4 see that #0 (zero the digit) not o (little o) at J4? j4 and j5 are the Detroyer sitting right (literally) along side the Battleship #7 You had 2 ships hit and because you sank none, ie The Destroyer, you can deduce 2 ships were sitting side by side vertically. I used #0 to designate ship #10 the computer's Destroyer to keep to one digit reveal. Yeah it looks a bit like a little o, sorry. Cool you are using a shooting pattern I call Mod 3. How is the blinking cursor working for you? tsh73b = b + ...
|
|
|
Post by tsh73 on Aug 3, 2024 19:58:07 GMT
Ah, that makes perfect sence, thank you
Looks simple enough mere human could remember ;)
Looke very nice. And most interesting it blinks all by itself Best code is the code you don't have to write ;)
|
|
|
Post by Rod on Aug 12, 2024 8:33:54 GMT
I was pulling together a sprite based graphic interface but I am out of time and away for a week. So I attach the sprite files and a short example of how they might be used. it would be a click to play style of game. Attachments:Battleships.zip (57.23 KB)
|
|
|
Post by Rod on Aug 12, 2024 8:38:44 GMT
Actually use this program instead of the bugged version in the .zip.
nomainwin
'open a window and graphicbox WindowHeight = 400 WindowWidth = 800 graphicbox #w.g, 50, 0, 700, 320 open "Battleship test" for window_nf as #w #w "trapclose [quit]" #w.g "down" loadbmp "sea","sea.bmp" loadbmp "sky","sky.bmp" for y=0 to 9 for x=0 to 9 #w.g "drawbmp sea ";x*32;" ";y*32 #w.g "drawbmp sky ";x*32+380;" ";y*32 next next #w.g "getbmp bac 0 0 800 320 ; background bac "
for n= 1 to 4 loadbmp "sub";n,"sub";n;".bmp" next #w.g "addsprite sub1 sub1 ; spritexy sub1 64 64" #w.g "addsprite sub2 sub2 ; spritexy sub2 96 64"
for n= 1 to 12 loadbmp "hit";n,"hit";n;".bmp" next #w.g "addsprite try hit1 hit2 hit1 hit2 hit3 hit2 hit3 hit4 hit3 hit4 hit5 hit4 hit5 hit6 hit5 hit6 hit7 hit6 hit7 hit8 hit7 hit8" #w.g "spritexy try 412 64 ; cyclesprite try 1" #w.g "addsprite mis hit12 hit9 hit8 hit9 hit10 hit9 hit10 hit11 hit10 hit11" #w.g "spritexy mis 444 96 ; cyclesprite mis 1 once" #w.g "addsprite hit hit1 hit2 hit1 hit2 hit3 hit2 hit1" #w.g "spritexy hit 476 128 ; cyclesprite hit 1"
timer 112, [cycle] wait
[cycle]
#w.g "drawsprites" wait
[quit] timer 0 close #w end
|
|