Weekly Qbasic and Qb64 Lesson Topics
April 18, 2024, 11:13:40 pm
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

Game Not Completely working,author unknown

Pages: 1 [2]
  Print  
Author Topic: Game Not Completely working,author unknown  (Read 1259 times)
Dustie Bear
Full Member
***
Posts: 115


« Reply #15 on: April 10, 2011, 10:20:22 pm »

Hi

Dug into this game a bit and found that when he does the put, it
 works ok,,,,,  BUT then he redraws the buildings back over the
top of it again so you never see the stack of boxes build up because he redraws the
entire screen after the PUT is done!

After I fgured that out, I looked where to fix it,  with all the spegheti code it
became almost imposible to find any logic in it.
He calls the redraw screen all over the place  and does gotos all over the place, what a mess.

Thats one example of why I dislike gotto's I never seen such spaghetti
code in my life. LOL

I take it back,,,,,, My arcade game doesnt look anything like that!! LOL

OldDos,,  I hadn't looked at this program real good till you gave me the
honor of working on it.   Grin

Stuck my foot in my mouth didn't  I?  Grin

Thanks for the offer just the same.

Have to give the guy credit though because he realy did try hard
to make a nice game for being a beginner. In my opinion his code shows he hasnt
been at this very long. With all that speghetti code he wrote he just got
lost in the flow of things till it got unmanageable.


Dustie
















« Last Edit: April 10, 2011, 10:38:01 pm by Dustie Bear » Report Spam   Logged
OlDosLover
Guest
« Reply #16 on: April 10, 2011, 10:40:46 pm »

Hi all,
    LOL @ Dustie.
OlDosLover.
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #17 on: April 10, 2011, 10:46:37 pm »

Ok Dusty, thanks, too on the explanations of the variables,..
well anyway, since we don't know who the author was, you don't have to worry about hurting anyones feelings!
From Garry
Report Spam   Logged

Dustie Bear
Full Member
***
Posts: 115


« Reply #18 on: April 10, 2011, 11:29:09 pm »


Ok guys, LOL

Just in case you want to make your own game of this it might be kinda fun. I know
you all are pretty busy with other aspects of programming at the moment.

I did a screen copy of the game then saved it as a png file in my paint Shop program
cause I thought  the picture was kinda cute, Reminded me of the early days of
programming etc.  Very plain!

I saved  it 640,480 and 32 bit even though there are only a few colors in it.
I like working in  32 bit.

Here it is if anybody interested in making a BETTER version of the game.  Roll Eyes
http://dl.dropbox.com/u/19871604/Stack.png


Dustie

PS, Your suppose to stack as many blocks as you can on the pink table in the center without to many tipping over. The higher you stack them the more points ya get.  if you tip them over 3 or 4 time ya have to start over. if you drop them anyplace other than the table you get penilized for that too. I played an online game like that and it was pretty fun, only that was stacking them on the back of a truck,



« Last Edit: April 10, 2011, 11:42:42 pm by Dustie Bear » Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #19 on: April 11, 2011, 08:07:46 pm »

Thanks Dusty I got the pitchure,
from Garry
Report Spam   Logged

OlDosLover
Guest
« Reply #20 on: April 15, 2011, 08:15:30 am »

Hi all,
    Here's a program description and an idea that can be converted into code fairly easy.
Quote
      An explanation of the drop box game
   Thinking about this game in the QBasic way dictates that we have to do things in a particular method and order. The components of the game are:
1] A background
2] A moving claw that has a box clasped ready to drop
3] A platform that the boxes should drop onto

   So we make the drawing of the entire background into one sub that creates it once and as we interact with it we must use dims to capture what will be overwritten by our animations and restored after the animations cease. As the background and platform dont change they can be drawn together at the same time. The claw appears over a black area so it can be redrawn when erased to animate it. Lastly we have 2 interacting actions that must be incorporated at the same time. If we drop a box then that part of the action is the box falling. We need to replace the overwritten background as the box falls. When the box lands we have to incorporate this immobile box into the background. Also we have to allow for interaction with the next box as it could land upon the first box.
   So we need two subs to do the boxes. The first sub simply redraws the box as it falls. Part of this sub is to replace the
background as the box moves downward. Upon reaching a stopping point the first sub terminates. Now the dropped box has to be represented into a "stack" if it is at the right place (platform). This stack can become part of the backgrond picture but we still need to interact with it for later boxes. One way to think of this as an idea is if the box is within the platforms location then the platforms top surface is rising.
   Also with this simple model we will disregard physics. In theory a moving box that drops still has sideways movement as well as downward movement. Also a dropped box will not balance if it lands on top of a pole. In theory it will stop , tilt , slide then continue falling. So to make this model the simplest is to disregard boxes that do not land  on the platform. Those boxes will disappear. If a box lands on the platform then it counts! Any box can balance upon another box even if it has contact only on an edge.
   The simplest sytem to detect if the falling box collides with another box is to use the point function to test the pixels at each corner bottom of the falling box. If our point returns the color of the box then it has to be another box. The only other valid color would be the platform color. Where the boxes end up is defined in an area that carn't be seen ahead of time. Another consideration should be to allow only one box onscreen at any time until the falling box's destination is decided. That way we can reuse the same subs over and over to react to the defined behaviours without anything unexpected happening.
   At this stage we have enough of a defined idea to go ahead and produce code. One thing that needs to be decided now is what are the terminating conditions? What brings about the end of the game and how is it decided wheather the player has won or lost? Currently we could keep count of the boxes in the satck and terminate on a successful number  of stacked boxes and terminate on a total numbers of attempts.

OlDosLover.
« Last Edit: April 15, 2011, 08:21:40 am by OlDosLover » Report Spam   Logged

Pages: 1 [2]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy