My new game - "The Squeeze"

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
dafhi
Posts: 1652
Joined: Jun 04, 2005 9:51

Re: My new game - "The Squeeze"

Post by dafhi »

I have a friend who loves your game. oh .. and .. there's enough randomness to keep someone from plowing their way through levels. you don't really need to increase the difficulty, but that's my opinion
BasicCoder2
Posts: 3917
Joined: Jan 01, 2009 7:03
Location: Australia

Re: My new game - "The Squeeze"

Post by BasicCoder2 »

dafhi wrote:I have a friend who loves your game.
That I find absolutely fascinating. To me it is simply Frogger trying to cross a multi lane highway and I would never have thought anyone would love doing that all day trying to maximize the number of frogs they could get across the highway. The frog has been reduced to a green disc and the cars to red discs. It is flappy bird all over again. All eye/hand reflexes no cognitive thinking required. Something to keep in mind if you want to write a game?

Googling for examples of mindless reflex games I came across this one which I liked for its humorous comments when I failed and when I succeeded in hitting the key in time.
http://www.gamesfreak.net/games/Zoi%3A-The-Escape.html

For me the Squeeze was so frustrating I tried a friendlier version (for me without good eye/hand reflexes) in which the green ball has lives. The score became how many times it could get to the top before running out of lives.

Code: Select all

screenres 640,480,32
dim as double now1
dim shared as integer score  'number of times reached top
dim shared as integer hits    'number of times hit with each trip to the top
dim shared as integer lives  'number of lives

type BALL
    as integer x
    as integer y
    as integer dx
    as integer dy
    as integer r
    as uinteger c
end type

dim shared as BALL balls(10)
for i as integer = 1 to 10
    balls(i).x = int(rnd(1)*300)+200
    balls(i).y = i*32+32
    balls(i).r = 9
    balls(i).c = rgb(255,0,0)
    balls(i).dx = int(rnd(1)*2)-1
    while balls(i).dx = 0
        balls(i).dx = int(rnd(1)*3)-1
    wend
next i


dim shared as BALL player
player.x = 200+150
player.y = 32*12
player.r = 9
player.c = rgb(0,255,0)

sub update()
    screenlock
    cls
    line (200,32-16)-(500,32+16),rgb(255,255,0),b
    for i as integer = 64 to 32*12 step 32
        line (200,i)-(500,i),rgb(0,0,255)
    next i
    for i as integer = 1 to 10
        circle (balls(i).x,balls(i).y),balls(i).r,balls(i).c,,,,f
    next i
    circle (player.x,player.y),player.r,player.c,,,,f
    locate 2,2
    print "SCORE =";score
    locate 4,2
    print "LIVES =";lives-hits
    screenunlock
end sub

update()
now1 = timer
dim as string key

lives = 20   'give player 20 lives

do
    if timer > now1 + 0.003 then
        now1 = timer
        if player.y = 32 then
            player.y = 32*12  'reset player
            player.x = 200+150
            score = score + 1
            lives = lives - hits
            hits = 0
        end if
        for i as integer = 1 to 10
            balls(i).x = balls(i).x + balls(i).dx
            if balls(i).x <= 200 or balls(i).x >= 500 then
                balls(i).dx = -balls(i).dx
            end if
        next i
        key = inkey
        if player.y > 32 then
            IF key= Chr(255) +"K" AND player.x > 200 THEN player.x = player.x - 32
            IF key= Chr(255) +"M" AND player.x < 500 THEN player.x = player.x + 32
            IF key= Chr(255) +"H" AND player.y > 32  THEN player.y = player.y - 32 
        end if
    end if
    for i as integer = 1 to 10  'for each ball
        if player.y = balls(i).y then
            if player.x = balls(i).x then
                hits = hits + 1
            end if
        end if
    next i
    update
    sleep 2
loop until multikey(&H01) or lives <= 0

cls
locate 20,30
print "GAME OVER"
locate 22,30
print "SCORE =";score
locate 26,25
print "hit space bar to exit"
key = inkey
while key<>" "
    key = inkey
wend
dafhi
Posts: 1652
Joined: Jun 04, 2005 9:51

Re: My new game - "The Squeeze"

Post by dafhi »

that's nice! msdos622wasfun has a great concept here.
i've been aware of a few game design elements for some time and definitely have a winner with my rung concept.

in no hurry :D

Here is an update of BasicCoder2's version with independent physics

Code: Select all

screenres 640,480,32
dim as double now1
dim shared as integer score  'number of times reached top
dim shared as integer hits    'number of time hit with each trip to the top
dim shared as integer lives  'number of lives

type BALL
    as integer x
    as integer y
    as integer dx
    as integer dy
    as integer r
    as uinteger c
end type

dim shared as BALL balls(10)
for i as integer = 1 to 10
    balls(i).x = int(rnd(1)*300)+200
    balls(i).y = i*32+32
    balls(i).r = 9
    balls(i).c = rgb(255,0,0)
    balls(i).dx = int(rnd(1)*2)-1
    while balls(i).dx = 0
        balls(i).dx = int(rnd(1)*3)-1
    wend
next i


dim shared as BALL player
player.x = 200+150
player.y = 32*12
player.r = 9
player.c = rgb(0,255,0)

sub update()
    screenlock
    cls
    line (200,32-16)-(500,32+16),rgb(255,255,0),b
    for i as integer = 64 to 32*12 step 32
        line (200,i)-(500,i),rgb(0,0,255)
    next i
    for i as integer = 1 to 10
        circle (balls(i).x,balls(i).y),balls(i).r,balls(i).c,,,,f
    next i
    circle (player.x,player.y),player.r,player.c,,,,f
    locate 2,2
    print "SCORE =";score
    locate 4,2
    print "LIVES =";lives-hits
    screenunlock
end sub

update()
now1 = timer
dim as string key

lives = 20   'give player 20 lives

dim as single   anim_fps = 30
dim as single   phys_fps = 200

' ~~~~~~ anim / physics / input ~~~~~~~
dim as single   anim_f, phys_f, ianim = 1 / anim_fps, iphys = 1 / phys_fps
dim as double   tNow = Timer, td, tp = tNow

do
'    if timer > now1 + 0.003 then
'        now1 = timer
    phys_f += td
    while phys_f > 0
        phys_f -= iphys
        
        if player.y = 32 then
            player.y = 32*12  'reset player
            player.x = 200+150
            score = score + 1
            lives = lives - hits
            hits = 0
        end if
        for i as integer = 1 to 10
            balls(i).x = balls(i).x + balls(i).dx
            if balls(i).x <= 200 or balls(i).x >= 500 then
                balls(i).dx = -balls(i).dx
            end if
        next i
        key = inkey
        if player.y > 32 then
            IF key= Chr(255) +"K" AND player.x > 200 THEN player.x = player.x - 32
            IF key= Chr(255) +"M" AND player.x < 500 THEN player.x = player.x + 32
            IF key= Chr(255) +"H" AND player.y > 32  THEN player.y = player.y - 32
        end if
        for i as integer = 1 to 10  'for each ball
            if player.y = balls(i).y then
                if abs(player.x - balls(i).x) < 10 then
                    hits = hits + 1
                    player.y = 32*12  'reset player
                end if
            end if
        next i
'    end if
    wend
    
    if anim_f <= 0 then
      update
      anim_f += ianim
    end If
    
    sleep 15 ' 15 reported having common behavior to most Win versions
    
    tp = tNow:  tNow = Timer:  td = tNow - tp
    anim_f -= td
    
loop until multikey(&H01) or lives <= 0

cls
locate 20,30
print "GAME OVER"
locate 22,30
print "SCORE =";score
locate 26,25
print "hit space bar to exit"
'key = inkey
'while key<>" "
do
    key = inkey
loop until key <> ""
msdos622wasfun
Posts: 21
Joined: Sep 25, 2011 1:54
Location: Michigan, USA
Contact:

Re: My new game - "The Squeeze"

Post by msdos622wasfun »

I'll probably insert that SLEEP statement in my loop ... was still wondering what "CPU friendly" means in this context though ... I kind of need a definition and how this is going to make that better ... :-)
msdos622wasfun
Posts: 21
Joined: Sep 25, 2011 1:54
Location: Michigan, USA
Contact:

Re: My new game - "The Squeeze"

Post by msdos622wasfun »

BasicCoder2 wrote:
dafhi wrote:I have a friend who loves your game.
That I find absolutely fascinating. To me it is simply Frogger trying to cross a multi lane highway and I would never have thought anyone would love doing that all day trying to maximize the number of frogs they could get across the highway. The frog has been reduced to a green disc and the cars to red discs. It is flappy bird all over again. All eye/hand reflexes no cognitive thinking required. Something to keep in mind if you want to write a game?
Oh, certainly not all day. Heck, this is just a time-wasting little game I came up with if somebody wants to play it in order to fight boredom for five or ten minutes. :-)

But I do admit I didn't see up until now how the concept shares some similarities with things like Frogger. All I can really say in my defense is that I'm not a professional programmer, and coming up with something truly revolutionary is hard to do. (Actually though, in Frogger, are you forced to move up after a certain amount of time? I haven't played it much so I'm not sure. That's where "the squeeze" comes into play, because you can't stay on the bottom rung forever ... you have to move up, and up, and up, constantly pressured by the limited amount of time you have to dodge the red balls as the left and right walls squeeze together.)

Personally I don't think Flappy-Bird type games are that bad, but that's just me. I've gotten just as bored playing $60 games that bring SLI GTX 980's to their knees. ;-)

I don't have much time right now but I'm going to take a look at the code samples that were submitted in this thread, probably later.

[EDIT: Don't forget there are other things I put in the game to try to make it unique and encourage the player to take risks, like the "Steps Bonus" that you see on the "LEVEL UP" screen when you make it to the top ... basically you get more points the more you move left and right, the more "steps" you take. So in a sense, sure, your common sense will tell you to just go up in a straight line as much as possible, but knowing that there will be an additional reward for increased movement of your green ball was something that I was hoping would make the game more tense, because you'll constantly have to weigh the pros and cons of doing that at any given moment.]
BasicCoder2
Posts: 3917
Joined: Jan 01, 2009 7:03
Location: Australia

Re: My new game - "The Squeeze"

Post by BasicCoder2 »

msdos622wasfun wrote:Personally I don't think Flappy-Bird type games are that bad, but that's just me.
They just make me look bad because I am rubbish at them :)

We all vary in what we find rewarding and more power to you for appealing to the reward system of a wide audience.
dafhi
Posts: 1652
Joined: Jun 04, 2005 9:51

Re: My new game - "The Squeeze"

Post by dafhi »

msdos622wasfun,

if I have a loop

Code: Select all

dim as integer playing = TRUE
while playing
  cls
  put (x,y), sprite, pset
  x+=1
  kstr = inkey
  if kstr = chr(27) then playing = FALSE ''escape
wend
Windows reports cpu (or core) utilization at 100%. if i put a sleep 1, utilization usually drops to less than 1%.
msdos622wasfun wrote:Oh, certainly not all day. Heck, this is just a time-wasting little game"
true also for PAC MAN, Galaga, Joust, 1942, Dig Dug .. :D The level of emotional 'saturation' when I play The Squeeze is right there at the top.

Also like to add that I appreciate BasicCoder2's distillation.
Last edited by dafhi on Mar 23, 2015 6:47, edited 2 times in total.
BasicCoder2
Posts: 3917
Joined: Jan 01, 2009 7:03
Location: Australia

Re: My new game - "The Squeeze"

Post by BasicCoder2 »

dafhi wrote:Also like to add that I appreciate BasicCoder2's distillation.
I have also distilled frogger,
http://www.freebasic.net/forum/viewtopi ... it=frogger
see the distillation in the games section.

What msdos622wasfun has demonstrated is you don't need fancy graphics or complex game play for a fun time waster.
msdos622wasfun
Posts: 21
Joined: Sep 25, 2011 1:54
Location: Michigan, USA
Contact:

Re: My new game - "The Squeeze"

Post by msdos622wasfun »

dafhi wrote:Windows reports cpu (or core) utilization at 100%. if i put a sleep 1, utilization usually drops to less than 1%.
Ah, I see now. Thanks for the tip -- I will probably use that from now on.
BasicCoder2
Posts: 3917
Joined: Jan 01, 2009 7:03
Location: Australia

Re: My new game - "The Squeeze"

Post by BasicCoder2 »

msdos622wasfun
Posts: 21
Joined: Sep 25, 2011 1:54
Location: Michigan, USA
Contact:

Re: My new game - "The Squeeze"

Post by msdos622wasfun »

I like that Zoi game. I think I'm going to download it for my Nexus tablet.

As far as The World's Hardest Game, fuggetaboutit........... :)

Couldn't get past the first level. :)

But I bookmarked it and still might go back to it later.
Post Reply