Ben Jimenez - Hi!

I want to share a program I am working on, I would like to post information about it here.
I am developing a small game, simple design, but since I need more programming experience anything I develop just helps give me more skill in my favorite past time. Ok, so I'm developing this game I call Color Match (the name for now, may change later). All you have to do in this game is match up 3 or more of the same color to earn points. Sounds easy huh, the catch is that the game board consist of 5 rings of colored circles that can be turned independently of each other. So instead of swapping two game pieces like in most other matching games this game requires that you rotate the rings in order to match up colors. As you progress through each level, the difficulty of the game increases as the game adds more colors to the game board. After a few levels it becomes more difficult to match up colors. You may notice that any color circles on the outer most rings will fall inward as you match up colors of the inner rings. This is by design. I thought it would make it more fun. I hope some find this game amusing and offer up some thoughts about how I may improve this game.

What I'm working on for the final release of this game.

Animation of the rotation of the rings, and animation of the movement of the colored circles when they fall inward toward the inner ring. I also want to take some time and develop some nice graphics and maybe a nice background or two. Midi music may be added, but I don't want to bog down the game so I might opt out of that idea. I am working on a prototype for the XBOX Indie game developers market place. This means I'm gonna have to re program this game in C++, but it should not be too much of a challenge since this game is basic in design. I can see the final game in my head and when everything is in place I will release it on every platform I can find time to program it for.

I am posting a tkn file for any who wish to try out the basic idea of the game. The tkn file was created in Just BASIC so you will need that installed to run it.

Code will be posted soon. Please post any comments or suggestions here. http://basic.wikispaces.com/message/list/Ben+Jimenez

[[code format="vb"]]

code
' /
'
*Color Match* /
' Copyright 2010 /
'
Author: Ben Jimenez /
' e-mail: ben_jimenez@yahoo.com /
'
/
' This program is the property /
'
of the author and may not be /
' reproduced or reposted /
'
without the authors consent. /
'///

'Setup Variables and starting values
dim gp$(11,6) 'game piece position and color array
'gp$( ,0)= value for game piece position
'gp$( ,1-5)=color value
'gp$( ,1)= color value string of game pieces
r=0 'temp value holder
ra=0 'radius value
maxcolor=3 'starting random color value
ring=1 'current selected ring
ringmax=5 'total number of rings
match=0 'color match trigger 1=match 0=no match
score=0 'player score
levelup=0 'next level required score
gametime=0 'Level time out count down
'colors for game pieces
colors$= "darkred darkpink darkblue lightgray red darkcyan yellow darkgreen brown pink blue green cyan darkgray"
'game piece location values
'values used 0.53,1.06,1.59,2.12,2.65,3.18,3.71,4.24,4.77,5.3,5.83,6.36
for v=0 to 11
r=r+.53 'increase value
gp$(v,0)=str$(r) 'store value as string
next v
'game board location
lx=350 'H location
ly=275 'V location
'Keyboard input
up$= chr$(_VK_UP)
lft$=chr$(_VK_LEFT)
rht$=chr$(_VK_RIGHT)
dwn$=chr$(_VK_DOWN)
shift$=chr$(_VK_SHIFT)
'Setup main window
nomainwin
WindowWidth = 700
WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2)
UpperLeftY=int((DisplayHeight-WindowHeight)/2)
menu #main ,"Game","New",[newgame],|,"Quit",[quit.main]
menu #main ,"Help","How to play",[howtoplay]
graphicbox #main.g, -1, -1, WindowWidth, WindowHeight
open "Color Match -- www.benjimenez.info " for window_nf as #main
#main.g, "down;fill black"
#main.g,"up;goto 220 100;backcolor black;color red;font arial_black 48;\COLOR"
#main.g,"up;goto 220 180;color blue;\MATCH"
#main.g,"flush"
#main.g "segment seg"
#main.g "delsegment ";seg-1

#main, "font arial 10"
#main, "trapclose [quit.main]"
wait
[loop]
#main.g "setfocus"
scan
gametime=gametime-1
if gametime<0 then
timer 0
#main.g "when characterInput"
notice "You ran out of time!!!!"
end if
if gametime>-1 then
#main.g "up;goto 595 30;down;size 1;backcolor black;color red;font arial 20;\Time"
#main.g "up;goto 600 60;down;size 1;backcolor black;color red;font arial 20;\ "
#main.g "up;goto 600 60;down;size 1;backcolor black;color red;font arial 20;\";gametime
end if
wait
[howtoplay]
notice "How to play";chr$(13);"Use the UP/DOWN arrow keys to select a ring. LEFT/RIGHT arrow to rotate ring.Press SHIFT to check for matches. Match 3 of more of the same color."
wait

[newgame]
levelup=0
score=0
gosub [setupgame]
gosub [drawboard]
#main.g "when characterInput [keycheck]"
timer 500,[loop]
wait
[keycheck]

key$ = left$(Inkey$, 2)
select case right$(key$,1)
case shift$
gosub [matchcheck]
if score>levelup then
timer 0
playwave "lvlup.wav",sync
maxcolor=maxcolor+1
if maxcolor>14 then maxcolor=14
gosub [setupgame]
timer 500,[loop]
end if
if match=1 then
gosub [drawboard]
playwave "match3.wav",async
match=0
end if

case up$
ring=ring+1
if ring>ringmax then
ring=ringmax
end if
gosub [drawboard]
case dwn$
ring=ring-1
if ring<1 then
ring=1
end if
gosub [drawboard]

case rht$
temp$=""
for t= 0 to 11 'save current colors
temp$=temp$;" ";gp$(t,ring)
next t
gp$(11,ring)=word$(temp$,11)
gp$(10,ring)=word$(temp$,10)
gp$(9,ring)=word$(temp$,9)
gp$(8,ring)=word$(temp$,8)
gp$(7,ring)=word$(temp$,7)
gp$(6,ring)=word$(temp$,6)
gp$(5,ring)=word$(temp$,5)
gp$(4,ring)=word$(temp$,4)
gp$(3,ring)=word$(temp$,3)
gp$(2,ring)=word$(temp$,2)
gp$(1,ring)=word$(temp$,1)
gp$(0,ring)=word$(temp$,12)
gosub [drawboard]
playwave "rotate.wav",async
case lft$
temp$=""
for t= 0 to 11 'save current colors
temp$=temp$;" ";gp$(t,ring)
next t
gp$(11,ring)=word$(temp$,1)
gp$(10,ring)=word$(temp$,12)
gp$(9,ring)=word$(temp$,11)
gp$(8,ring)=word$(temp$,10)
gp$(7,ring)=word$(temp$,9)
gp$(6,ring)=word$(temp$,8)
gp$(5,ring)=word$(temp$,7)
gp$(4,ring)=word$(temp$,6)
gp$(3,ring)=word$(temp$,5)
gp$(2,ring)=word$(temp$,4)
gp$(1,ring)=word$(temp$,3)
gp$(0,ring)=word$(temp$,2)
gosub [drawboard]
playwave "rotate.wav",async
end select

wait

[setupgame]
'get random colors
for v=0 to 11
gp$(v,1)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,2)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
next v
'reset timer
gametime=300
levelup=levelup+1000
#main.g "down;fill black;flush"
return
[drawboard]
for i=0 to 11 'loop through game pieces
ra=50 'starting radius
for d=1 to 5 'loop through rings
ra=ra+40 'increase radius
'set game piece location
x=int(cos(val(gp$(i,0)))*ra)+lx
y=int(sin(val(gp$(i,0)))*ra)+ly
'set selected ring color
if d=ring then
rclr$="white"
else
rclr$=gp$(i,d)
end if
'draw game pieces
#main.g, "backcolor ";gp$(i,d);";color ";rclr$
#main.g, "size 3;up;place ";x;" ";y;";down;circlefilled 18 "
#main.g,"color white;up;goto ";lx;" ";ly;";down;size 1;circle ";ra-18
next d
next i
#main.g,"up;goto 50 30;down;size 1;backcolor black;color red;font arial 20;\Score"
if score>0 then
#main.g,"up;goto 50 60;down;size 1;backcolor black;color red;font arial 20;\";score
end if
#main.g "segment seg"
#main.g "delsegment ";seg-1
#main.g, "flush"
return
[matchcheck]
for v=0 to 11
if gp$(v,2)=gp$(v,1) and gp$(v,3)=gp$(v,1) and gp$(v,4)=gp$(v,1) and gp$(v,5)=gp$(v,1) then
score=score+50
gp$(v,1)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,2)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if

if gp$(v,2)=gp$(v,1) and gp$(v,3)=gp$(v,1) and gp$(v,4)=gp$(v,1) then
score=score+40
gp$(v,1)=gp$(v,5)
gp$(v,2)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if

if gp$(v,3)=gp$(v,2) and gp$(v,4)=gp$(v,2) and gp$(v,5)=gp$(v,2) then
score=score+40
gp$(v,2)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if

if gp$(v,2)=gp$(v,1) and gp$(v,3)=gp$(v,1) then
score=score+30
gp$(v,1)=gp$(v,4)
gp$(v,2)=gp$(v,5)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if

if gp$(v,5)=gp$(v,3) and gp$(v,4)=gp$(v,3) then
score=score+30
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if

if gp$(v,3)=gp$(v,2) and gp$(v,4)=gp$(v,2) then
score=score+30
gp$(v,2)=gp$(v,5)
gp$(v,3)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,4)=word$(colors$,int(rnd(1)*maxcolor)+1)
gp$(v,5)=word$(colors$,int(rnd(1)*maxcolor)+1)
match=1
end if
next v

return

[quit.main]
#main.g "when characterInput"
timer 0
close #main
end