Page 1 of 1

WRITING A SIMPLE GAME PROGECT.

Posted: Mon Mar 31, 2008 1:15 pm
by orgmatter
Hello All,

I Am Trying To Write A Simple Game Program With Qbasic.

The Idea Is For The Game To Have An Option (continue, Quit), 3levels, A Timer And Preferably A Sound.

The Basic Pattern Is To Have A Few Boxes Moving From Left To Right At The Top Of The System, And For A Shooter To Be Below Aiming At The Boxes Above.

Please Someone Try And Come Up With Something In Time. PLEEEASE.

I'VE GOT TO SUBMIT IT THIS WEEK, BUT TAKE YOUR TIME.

Thanks Sincerely.
orgmatter@gmail.com

Posted: Mon Mar 31, 2008 2:07 pm
by TmEE
removed the code, write your own stuff

Bad boy!

Posted: Mon Mar 31, 2008 2:34 pm
by burger2227
We don't do homework here! If a person cannot spend a little effort on their own, then the heck with them. We can help with code problems however.

Posting code for a cheater is NOT acceptable on this or any other QB forum! DO NOT DO it again! You could be banned TMEE!

Besides, your code is probably EASY to spot by a teacher LOL.

Ted

Posted: Mon Mar 31, 2008 2:37 pm
by TmEE
OK, I'll not do it again !!! Is it mentioned in the forum rules too somewhere ? (I might have missed something)

Posted: Mon Mar 31, 2008 6:30 pm
by burger2227
Not sure here, but it is a well known tradition. I cannot say that the poster is looking to cheat, but if he does not post any code he has tried then he is just being lazy.

That and the fact his post is in all capital letters, SCREAMS for help without any participation from him/her.

Thanks for removing it!

Ted

Posted: Mon Mar 31, 2008 8:38 pm
by Mentat
Well, break it down into parts. Such as a sub for drawing boxes.

Burger is right. We're here to help, not do work somebody else should be doing. And regurgitating code doesn't help with the learnign process. If somebody wants to know correct syntax of PUT or help with debugging a sub, then it's okay.

Posted: Tue Apr 01, 2008 12:47 am
by TmEE
I'm totally new here, so I don't know everything, sorry.... anyway I plan to stay and if there's more thing to avoid tell me.

Posted: Tue Apr 01, 2008 1:11 am
by Mac
TmEE wrote:OK, I'll not do it again !!! Is it mentioned in the forum rules too somewhere ? (I might have missed something)
The "no do homework" rule is universal. No forum anywhere will simply do your homework.

a) You do the best you can
b) You post what you did
c) We give hints and answer specific questions

Example

You: Why does it stop when it gets to e=a=n?

Us: The answer is that you meant e=a-n which is a legal statement.

THE GAME DESIGN AGAIN.

Posted: Tue Apr 01, 2008 3:05 am
by orgmatter
HELLO ONCE AGAIN,

PLEASE DONT GET ME WRONG, I AM NOT ASKING ANYBODY TO DO THW WHOLE WORK.

I AM USED TO SOME QBASIC PROGRAMMING LANGUAGE, I HAVE INFACT DRAWN THE BOXES, BUT I DON'T KNOW HOW TO MOVE THE BOXES HORIZONTALLY IN AN ANIMATION WAY.

AND THEN MOVE THE BULLETS VERTICALLY.

I KNOW MY LINE STATEMENTS, BUT I NEED TO KEEP THE BOXES MOVING HORIZONTALLY WHILE AIMING AT THEM WITH A SHOOTER BELOW.

THANKS FOR YOU MUCH ANTICIPATED EFFORT.
orgmatter@gmail.com

Posted: Tue Apr 01, 2008 6:06 am
by Mentat
Okay, think in coordinates. Now move the coordinates.

Here's a way to move a dot across the screen in QB

Code: Select all

screen 12

cls

'coordinates
dim x%
dim y%

'something to hold keyboard input
dim k$

do
     'keyboard input
     k$=inkey$
     
     'move the dot 1 over, 1 down
     x%=x%+1
     y%=y%+1

     'draw it
     pset(x,y),15
     'clear up behind it
     pset(x-1, y-1),0

     'slow down the frame
     sleep 1
loop while key$=""

end

Posted: Tue Apr 01, 2008 8:16 am
by BDZ
Just so you know, orgmatter, posting in all capitals is rude because all capitals in emails and forum posts means shouting. Just post in all lowercase if you don't feel like using the shift key anymore.

No doubt the Clip will fly off his handle when he sees your post...

Posted: Tue Apr 01, 2008 9:54 am
by burger2227
POST YOUR CODE if you want help!

Ted

blanked out by user

Posted: Wed Apr 02, 2008 12:28 am
by Kiyotewolf
blanked out by user

repost

Posted: Wed Apr 02, 2008 12:41 am
by Kiyotewolf
gimmie a break.. take your knives and put them up... sheesh..




ok..

you have to make a timer,.. that is something you will need..

t!=timer:while timer-t!<1 : wend

timer thingy done


rem do space invader left right motion
c=1
a = a + c

rem check for edges of world by edges of thingy moving
if A > (320 - widthOFbox) then C= -C
if A < 0 then C = -C
rem keep your thingy on the screen for safety,especially when using PUT
if a > (320 - widthOFbox) then a = (320 - widthOFbox)
if a < 0 then a =0

As you can see, C will reverse when the thingy gets to the edges.

It will go back and forth like space invaders now.

Now, when Y of your missile is less than.. heightOFbox.. then check to see if it is within the space horizontally of the the target.

rem did user press space bar? if so move our little missile up
if inkey$=chr$(32) then d=-1
y=y-d
If Y < heightOFbox then
if (X => xOFbox) and (X <= (xOFbox+widthOFbox)) then
hit = TRUE
rem move new missile to bottom, reset motion flag for missile
y = 199
d=0
END IF
END IF

don't forget to say TRUE = -1 somewhere..
or..

false = 0
true = NOT false


Ok.. simple boolean logic quiz..

z = (x = 1)

wait.. what?

we put a math test equation inside parenthesis, the value of the whole set that is the parenthesis becomes either TRUE (-1) or FALSE (0).

-1 is TRUE because it is all the bits,.. 65536,.. but in double signed numbers, it becomes -32767 or something like that.. blah blah..

all you have to know is you can create a test for something by putting a variable is < or <= or = or => or > to a value or another variable by encasing it in ( ....) and then it will return either a 0 or a -1

now,.. you can use this by doing simple boolean logic.. (digital gates logic..)

AND ,.. OR.. XOR.. IMP.. (you can look these up in QBasic help or press F1 while your cursor is over a keyword..).. and do multiple tests in one go.

You can even use the result as math itself.

x = 4 - (y = 1)

if y was 1, then (y = 1) would equal -1, which would mean x = 5.




this is simple code.. but if you look at it,.. you can see how it is going to work..

The essentials are this.. A timer to make it stay on the screen long enough to be visible, and variables that check themselves and modify what your thingys are doing.

I haven't answered his question or done his homework and if anyone blocks or erases my post i will toss flaming sporks at you..

kudos and good luck

Kiyote Wolf

Awarewolf?

Posted: Wed Apr 02, 2008 12:56 am
by burger2227
??? are you talking about? Until code is submitted by the original poster, do your coloring book!

NEVER TOSS CODE around bucco!

Posted: Wed Apr 02, 2008 11:45 am
by sid6.7
there is NO RULE that you cannot help someone do thier homework
so you can repost your code if you want TMEE....

the rule is that if someone wants help with thier homework they
need to post the code they have DONE so far if they want
help...we are not here to do peoples homework for them...thats
cheating...

so if you haven't done any code...your just gonna get ignored
or flamed for the most part....
or in some cases depending
on the moderator the question just gets deleted....

regards
moderator...

flame on

Posted: Sun Apr 06, 2008 1:17 am
by Kiyotewolf
Flaming is a waste of time in my book, no matter what "crime against humanity" people have done..

I personally think flaming is degrading,.. and I agree.. the original coder should write their code, .. but to me it sounds like this coder is a n00b to QBasic completely,.. or at least seems that way..

I don't agree with posting an answer to a problem,.. all i did was post semantics about how to do this and that.. but it's kinda depressing when someone does the work for you..

** noms on a donut.. **

bai peeps..