WRITING A SIMPLE GAME PROGECT.

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
orgmatter
Newbie
Posts: 2
Joined: Mon Mar 31, 2008 12:57 pm
Contact:

WRITING A SIMPLE GAME PROGECT.

Post 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
orgmatter
TmEE
Veteran
Posts: 97
Joined: Mon Mar 17, 2008 11:14 am
Location: Estonia, Rapla
Contact:

Post by TmEE »

removed the code, write your own stuff
Last edited by TmEE on Mon Mar 31, 2008 2:45 pm, edited 1 time in total.
Mida sa loed ? Nagunii aru ei saa :P
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Bad boy!

Post 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
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
TmEE
Veteran
Posts: 97
Joined: Mon Mar 17, 2008 11:14 am
Location: Estonia, Rapla
Contact:

Post by TmEE »

OK, I'll not do it again !!! Is it mentioned in the forum rules too somewhere ? (I might have missed something)
Mida sa loed ? Nagunii aru ei saa :P
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post 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
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post 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.
For any grievances posted above, I blame whoever is in charge . . .
TmEE
Veteran
Posts: 97
Joined: Mon Mar 17, 2008 11:14 am
Location: Estonia, Rapla
Contact:

Post 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.
Mida sa loed ? Nagunii aru ei saa :P
Mac
Veteran
Posts: 151
Joined: Mon Aug 06, 2007 2:00 pm

Post 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.
orgmatter
Newbie
Posts: 2
Joined: Mon Mar 31, 2008 12:57 pm
Contact:

THE GAME DESIGN AGAIN.

Post 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
orgmatter
User avatar
Mentat
Veteran
Posts: 409
Joined: Tue Aug 07, 2007 3:39 pm
Location: NC, US

Post 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
For any grievances posted above, I blame whoever is in charge . . .
BDZ
Coder
Posts: 49
Joined: Sun Nov 20, 2005 5:41 pm
Location: Wisconsin
Contact:

Post 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...
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Post by burger2227 »

POST YOUR CODE if you want help!

Ted
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

blanked out by user

Post by Kiyotewolf »

blanked out by user
Last edited by Kiyotewolf on Wed Apr 02, 2008 12:42 am, edited 1 time in total.
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

repost

Post 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
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Awarewolf?

Post by burger2227 »

??? are you talking about? Until code is submitted by the original poster, do your coloring book!

NEVER TOSS CODE around bucco!
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
sid6.7
Veteran
Posts: 318
Joined: Tue Jun 21, 2005 8:51 am
Location: west USA
Contact:

Post 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...
User avatar
Kiyotewolf
Veteran
Posts: 96
Joined: Tue Apr 01, 2008 11:38 pm

flame on

Post 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..
Banana phone! We need more lemon pledge. * exploding fist of iced tea! * I see your psycho cat and counter with a duck that has a broken leg, in a cast.
Post Reply