You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


Connect Four in QB64
06-15-2014, 05:15 PM (This post was last modified: 07-21-2014 01:22 AM by Waltersmind.)
Post: #1
 (Print Post)
Connect Four in QB64
Here is my connect Four game in QB64. It is a 2 player game. Game controls: Number keys to select desired column and press ENTER to place piece on board.

I originally wrote it close about 30 years ago on the TRS-80 Model 4 using ASCII character set for graphics. The Model 4 used a B&W monitor. High Resolution Graphics were available as a option to purchase for it. I never bought it, but wish I did.

When I purchased the Tandy 2000 in late 1986, Connect Four was the first game I wrote on it in High Resolution Color Graphics in GW-BASIC. There was an option to buy a Compiler BASIC, but I never did. Running the game in the BASIC interpreter, my wife liked that, watching the board and pieces being drawn onto the screen.

A few months ago I stated getting back into programming after a 20 year break. QB64 is the perfect language to come back with and remake my games again, so I can play them again and on newer computer systems. And so I can share my games with others to enjoy as well.

I posted this game in QB64.net forum and wanted to share it here also. I enjoy receiving comments and suggestions about my games. So, if you try my games, please leave comment. Just keep in mind that I originally write it about 30 years ago and my goal is to reproduce my games as close to as they were originally done within reason. I have made some improvements on the games, because I have more colors to work with.

Donald

   

       


Attached File(s)
.bas  Connect Four.bas (Size: 3.51 KB / Downloads: 1131)
Find all posts by this user
Like Post
The following 2 users Like Donald Foster's post:
Anthony.R.Brown, Waltersmind (Admin)
06-20-2014, 05:23 PM (This post was last modified: 06-20-2014 05:24 PM by Anthony.R.Brown.)
Post: #2
 (Print Post)
RE: Connect Four in QB64
Hi Donald

You have wrote some Cool Games! Maybe yo would like to get involved with My QBASIC CHESS 2014 

http://www.thejoyfulprogrammer.com/qb64/...php?tid=63

Graphics are One of My weaknesses take a look at the link above! Smile



Anthony.
Find all posts by this user
Like Post
06-20-2014, 09:28 PM (This post was last modified: 12-08-2016 03:20 PM by Waltersmind.)
Post: #3
 (Print Post)
RE: Connect Four in QB64
Quote:
Hi Donald,

You have wrote some Cool Games! Maybe yo would like to get involved with My QBASIC CHESS 2014:  http://www.thejoyfulprogrammer.com/qb64/...php?tid=63.

Graphics are One of My weaknesses take a look at the link above! Smile


Anthony.


I actually started making a chess game over 25 years ago, but never completed it. Other games took preference. 

All the board and game piece graphics I use are all hand drawn. None of them are image files loaded into the game. How ever, I have tinkered with GameMaker a little and have created sprites to use with objects in the games. 

I used mouse input in GameMaker and even did some programming in GML. But, never used any mouse input in BASIC. Until recently when I started remaking my games in QB64, none of my computer I wrote in BASIC ever had a mouse.

All the games I make are 2 or more human players. I never learned any A.I. programming and don't know how.

I am interested, but I feel I'm far out of your league to be any help to you. But let me know if you have any questions. I'll help as much as I can. Maybe in the process, I can gain some knowledge in unfamiliar areas.

Thank you for the offer.

Donald
Find all posts by this user
Like Post
06-20-2014, 10:43 PM (This post was last modified: 07-21-2014 01:32 AM by Waltersmind.)
Post: #4
 (Print Post)
RE: Connect Four in QB64
I'm in the middle of remaking several of my games at the moment and even taking on some new ones also like Blokus.

I have already written Blokus in my mind over a hundred times.

I have one game that is almost finished, but it has a problem that I have racked my brains out, trying to figure out where the problem is. It's a very nice game, but it may need some help.

Here's a screenshot of the game I'm almost finished with.


Donald


Attached File(s) Image(s)
   
Find all posts by this user
Like Post
06-21-2014, 07:51 AM
Post: #5
 (Print Post)
RE: Connect Four in QB64
Hi Donald

As I said you have made some Nice Games! I like Simple looking Games (if you don't mind Me saying Smile) that can have Very Complex Game play! it's Not! always what is on the Surface...you only have to look at some Simple Math problems to know that!

I am no more Advanced than you! it's just that we have Gone into different Area's and again My weakness is Graphics and understanding how Arrays & Functions work in a Complex way!

The QBASIC CHESS 2014 is Something I have always wanted to do! it will Not! be just about getting the Program to work and look better it will be about understanding Everything that makes a Game Program work! from Start to Finish with loads of REMARKS and Clear Explanations as to what everything does.
So I will be getting Educated and hopefully Others as to How to do it... which can then be used in many other Programs! a bit like the Building Blocks of Programming!

Thank's for the Response take a look sometimes at the Project!...and Post anything you think will be helpful...I Will ask you sometimes as things Crop up! Please feel Free to do the same with Me! Smile


Anthony.
Find all posts by this user
Like Post
06-21-2014, 11:01 PM
Post: #6
 (Print Post)
RE: Connect Four in QB64
I took a look at you checkersx game. That was an interesting concept how you used the arrow key to move the cursor. When I make my games that play on the diagonal, I used the number key pad. with 5 being your current location, pressing 1, 3,7 & 9 would move the cursor left down, right down, left up & right up. Numbers 2,4,6 & 8 would move the cursor down, left, right & up.

Anyway getting back to Chess 2014. Will you be using mouse input or keyboard?

 You also mentioned using full screen. I messed around trying to use full screen, but my graphics get distorted. I like using the 1000x725 window for 2 reasons. 1: if someone wanted to play my games on a CRT monitor, that resolution works fine. I still own 3 computers with CRT monitors. 2: If something happens during the making or during the end result and the program gets caught up in an endless loop, I can X out the window to terminate it. In, full screen, I'd have to force the computer to shut down to terminate the program.

I looked at the image files for the pieces, they are very nice. I was thinking instead of using solid black and white squares, maybe finding some marble images to represent the squares. 

Also, there are 2, 3, 4, 5 & 6 player chess sets. Are these options something to consider?

Do you want to have an option when a player clicks on a piece, the computer hi lights all the squares for that moves?

You will need a way to unselect a piece that you have clicked on and choose a different one. That is pretty easy. With keyboard input, I offer ways. 1: press BACKSPACE or press ENTER while at the at the current selected piece location.

Do you want to use row and column notation to record moves and maybe even save a game in play and load and it back up?

These are just some questions. Also is this where the CHESS 2014 will be located?

Donald
Find all posts by this user
Like Post
06-22-2014, 06:34 AM (This post was last modified: 06-22-2014 07:51 AM by Anthony.R.Brown.)
Post: #7
 (Print Post)
RE: Connect Four in QB64
Quote:
I took a look at you checkersx game. That was an interesting concept how you used the arrow key to move the cursor. When I make my games that play on the diagonal, I used the number key pad. with 5 being your current location, pressing 1, 3,7 & 9 would move the cursor left down, right down, left up & right up. Numbers 2,4,6 & 8 would move the cursor down, left, right & up.

Anyway getting back to Chess 2014. Will you be using mouse input or keyboard?

 You also mentioned using full screen. I messed around trying to use full screen, but my graphics get distorted. I like using the 1000x725 window for 2 reasons. 1: if someone wanted to play my games on a CRT monitor, that resolution works fine. I still own 3 computers with CRT monitors. 2: If something happens during the making or during the end result and the program gets caught up in an endless loop, I can X out the window to terminate it. In, full screen, I'd have to force the computer to shut down to terminate the program.

I looked at the image files for the pieces, they are very nice. I was thinking instead of using solid black and white squares, maybe finding some marble images to represent the squares. 

Also, there are 2, 3, 4, 5 & 6 player chess sets. Are these options something to consider?

Do you want to have an option when a player clicks on a piece, the computer hi lights all the squares for that moves?

You will need a way to unselect a piece that you have clicked on and choose a different one. That is pretty easy. With keyboard input, I offer ways. 1: press BACKSPACE or press ENTER while at the at the current selected piece location.

Do you want to use row and column notation to record moves and maybe even save a game in play and load and it back up?

These are just some questions. Also is this where the CHESS 2014 will be located?

Donald

Hi Donald

First of all the CheckerX Game is Not! mine (: I wish it was...but it is another Game I would like to improve and bring up to Date in the same way as QBASIC CHESS 2014
For the Chess it's always best to use the simple Click on a Piece and move/Drag to a Square method using a Mouse!
The Full Screen was just a Statement because of how small the Original Program Screen display is Smile as long as it's almost Full screen and possibly adjustable to a smaller screen...like you have said above!

Your Quote: (Also, there are 2, 3, 4, 5 & 6 player chess sets. Are these options something to consider?)

I am Not! sure about that I have not noticed that in the Program at the moment.


High lighting the Piece that you have clicked on is always a Good idea!


Unselecting a Piece can be done just by Clicking on it again.


I would like to use full Notation like 1.E2 - E4 It's then much better for replaying games as there can Only be One Piece on any given Square like E2 or E4 Etc.


Game save is a definite requirement and being able to load a Game .PGN Format is the Best! as it's the most universal.


QBASIC CHESS 2014 Will be in the Thread all the time! and as the Program progresses... updated Saves can be saved by Date...easily showing the last Version and where it is up to something like QBASICCHESS2014-D220614.BAS


I would also like an Analyses Output Window! (Turn on/off) I am thinking about the best layout at the moment! ?

And back to the (Board) A - H & 1 - 8 Notation showing where the Squares are.

I Have just done the above! Smile and made  QBASICCHESS2014-D220614.BAS  take a look below the Program is Now! made up of (17) different Sections for People to work on.

http://www.thejoyfulprogrammer.com/qb64/...139#pid139


Anthony.
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Blokus
QB64 Member Project - Isolation
QB64 Member Project - Basic Dithering
QB64 Member Project - Kings Valley verion one
QB64 Member Project - ARB Checkers
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Exit
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Quarto
QB64 Member Project - Spiro Roses
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Inside Moves
QB64 Member Project - Rubix's Magic
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Score 4
QB64 Member Project - Touche
QB64 Member Project - Overboard
QB64 Member Project - Color Triangles
QB64 Member Project - Pivet version one
QB64 Member Project - Connect Four
QB64 Member Project - Othello
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Algeria Weather
QB64 Member Project - Foursight
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Line Thickness
QB64 Member Project - Bowditch curve
QB64 Member Project - Dreamy Clock
QB64 Member Project - Color Rotating Text
QB64 Member Project - Kings Court
QB64 Member Project - Point Blank
QB64 Member Project - Amazon
QB64 Member Project - Rotating Background
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Swirl
QB64 Member Project - Input
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Pivot version two
QB64 Member Project - Sabotage
QB64 Member Project - Dakapo
QB64 Member Project - 9 Board
QB64 Member Project - Splatter
QB64 Member Project - Domain
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Qubic