Author Topic: One Key Connect 4 (8x8) Halloween Style  (Read 10998 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #15 on: October 22, 2021, 01:16:26 pm »
Oh I just had interesting idea, since the board is now see through, you should be able to see your opponent!

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #16 on: October 22, 2021, 01:17:36 pm »
Good halloween game!  Plays strong too.  Still trying to beat it...

- Dav

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #17 on: October 22, 2021, 02:25:00 pm »
Rats that overlay screwed up the timing for the drop, sorry Pete I just noticed.

PS well it was slowing down the more pieces you put on the board anyway.

Back to the drawing board. ;(

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #18 on: October 22, 2021, 02:54:46 pm »
Ironic. Hardware acceleration creates pumpkin deceleration. Maybe Steve can help. Oh wait, he only raises pumpkins, he doesn't drop them.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #19 on: October 22, 2021, 03:12:28 pm »
Naw, no wonder here. I was re-drawing all the pieces live, to keep them moving. That's pretty intense processing time. Should be able to fix with static pieces with solid backgrounds as pieces would appear in real game, if I want to fool around with this.

I do have an image of the opponent the human sees (and sees through overlay) that I'd love to use with this!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #20 on: October 22, 2021, 03:31:55 pm »
Yeah, but what ya doesn't haz is my permyission ta use it!

 - Sam :D
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Cobalt

  • QB64 Developer
  • Forum Resident
  • Posts: 878
  • At 60 I become highly radioactive!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #21 on: October 22, 2021, 08:06:48 pm »
Naw, no wonder here. I was re-drawing all the pieces live, to keep them moving. That's pretty intense processing time. Should be able to fix with static pieces with solid backgrounds as pieces would appear in real game, if I want to fool around with this.

I do have an image of the opponent the human sees (and sees through overlay) that I'd love to use with this!

Yeah, time to add layering

putimage opponent
putimage tiles
putimage overlay
show the tile and text on top of the screen
display to screen

the problem with that though is the animation on the tiles, what you could do though is pre-render the animations on still more layers and just use putimage to place them to the tile layer. I think the Fill routines are a bit slower than just putimage? Then you could use a timer to cycle the frames.

I just wish your variable naming convention was a bit more descriptive. ¯\_(ツ)_/¯

Although this is one reason I don't use _DISPLAY in that manner. if the program window hits the edge of the screen this happens.
scratched.jpg
* scratched.jpg (Filesize: 278.49 KB, Dimensions: 1360x768, Views: 262)
Granted after becoming radioactive I only have a half-life!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #22 on: October 22, 2021, 08:18:31 pm »
It looks like your CPU may be running a bit too hot @ melting effect. Wow, I never imagined a situation like that could happen, but then I don't get out of SCREEN 0, much.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #23 on: October 22, 2021, 08:31:08 pm »
Getting a sticky spider image on the screen once in a while.  My pumpkin falls right through it when it happens.

Still haven't won yet.  :(

- Dav

 
stickyspiders.jpg

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #24 on: October 22, 2021, 08:42:49 pm »
You're probably playing it while on the web!

Mark put together a really good AI algorithm. I played about 8 times and only one once.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #25 on: October 22, 2021, 09:27:23 pm »
I was hoping to get something like this going. It's nice to be able to see your opponent.
 
Now you can see your opponent!.PNG

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #26 on: October 22, 2021, 09:37:31 pm »
Doesn't Steve have a more recent photo? Anyway, I'd prefer Marvin.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #27 on: October 22, 2021, 09:56:46 pm »
@Cobalt Did you insert resizable in code?

I tried dragging and banging title bar around and don't have a melting problem on my system. Other apps do stick and expand to fill side of screen but not my QB64.

@Dav I've never seen the spider stick like that in my games.

@Pete where we are playing Connect 4 there is hardly any gravity, so maybe it's OK if pieces float down.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #28 on: October 22, 2021, 10:12:30 pm »
@bplus:  when it happened, it was when a new game has started, and the leftover spider was from the previous game but didnt erase off the screen.  Only happened a couple times.

EDIT: Finally won one!  Now my wife can stop laughing at me.  I agree @Pete, the AI algo is really great (or I just really bad).  Good job @bplus.

- Dav
« Last Edit: October 22, 2021, 10:25:56 pm by Dav »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: One Key Connect 4 (8x8) Halloween Style
« Reply #29 on: October 22, 2021, 11:05:46 pm »
@Dav you had it figured out some time ago, my guess your memory getting like mine. This is old Connect 4 posted almost year ago but now we see our opponent!

 
That AI Spider did it again.PNG


Just can't see it's pieces as well ;-))