The Daily Click ::. Forums ::. Non-Klik Coding Help ::. True Basic?
 

Post Reply  Post Oekaki 
 

Posted By Message

Dalal



Registered
  28/03/2004
Points
  307
3rd April, 2006 at 16:51:42 -

I'm taking a programming class in which we are learning True Basic. During the last 4 and a half weeks of class, we are going to be working on our FINAL projects. Well, I want to do a simple Mario game for my project. I've already created a horrible pong game, and some other games which involve key input, but no matter how much I experiment with Key Input and Get Key and all that, I can't make it so that the keyboard's repeat delay doesn't interfere. You know in MMF how when you hold a key down, it immediately responds. In True Basic I'm trying to make it so that -- Repeat While "Right Arrow" is Pressed -- Do something... you know what I'm saying? What's a good way to do this in True Basic?

Also, does anybody know of a website which teaches game-making in True Basic? Or are there any platform game engines in True Basic. I need one, cause I really want to make my project good... Is making a game like Mario even POSSIBLE in True Basic? With proper coding, would you actually be able to create platformers. I haven't learned too much of True Basic but I can't find code that allows you to do an equivalent of MMF's "Repeat While Key is Pressed"... So, basically, my questions are:

1. How do I do a proper "Repeat While Key is Pressed" in True Basic?
2. Anybody know of any Mario or platform game engines written in True Basic?
3. Can you load pictures with Transparency in True Basic? I can't find out how...

Hope someone can help!

Thanks,
Dalal

Image Edited by the Author.

 
.bin there done .dat

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
3rd April, 2006 at 17:38:53 -

If it's anything like VB6, you can use the KeyPress instead of GetKey event I believe. I think the GetKey event is used to get the actual ASCII code for the keyboard input at runtime. (ex. The "Enter" Key is ASC Key Code 13)

Equin Village uses this, and the guy will continue to move in the desired direction for as long as you hold the arrow key down, as in MMF's repeat while pressed event.

As for transparency, in VB6 you can't. In order to do it you have to use an API call called BitBlt. Basically, you have to create the actual sprite, and also do a "mask" for said picture that's entirely in black and white. I can't recall exactly HOW to do this, as the API Library call is complicated, but google BitBlt and see what turns up.

Hopefully, the two languages are similar and this helps!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Dalal



Registered
  28/03/2004
Points
  307
3rd April, 2006 at 22:52:21 -

Thanks,

From what I've seen, True Basic's syntax is very similar to that of VB. I'll try the KeyPress and hopefully I'll get transparency to work too. Thanks a lot! Also, anyone know of any websites containing True Basic engines or anything like that? I doubt there are any, but still...

EDIT: I got a basic to True Basic code converter from the True Basic Website, so now I can convert source from Basic to True Basic. Now, the problem is, I want to find the source of a Mario game created in Basic. Anybody know where to find this?

Thanks,
Dalal

Image Edited by the Author.

 
.bin there done .dat

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
4th April, 2006 at 04:48:44 -

im still using quickbasic . also if true basic is anything like qbasic think if you store the getkey to a variable it runs better.

As for transparencies, i think your talking like seethrough sprites. yes? no? cause i dont think bit blt is for transparecies

in qbasic to do read a sprite thats 10x10 pixels then its mask and place them down to make extra pixels invisible its:

SCREEN 13

DIM sprite(10, 10)
DIM spritemask(10, 10)

FOR y = 1 to 10
FOR x = 1 to 10
READ z
PSET (x, y), z
NEXT: NEXT

GET (0, 0)-(10, 10), sprite

FOR y = 1 to 10
FOR x = 1 to 10
READ z
PSET (x, y), z
NEXT: NEXT

GET (0, 0)-(10, 10), spritemask

PUT((x coord), (y coord)), spritemask, AND
PUT((x coord), (y coord)), sprite, OR

DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,000,000,000,000,000,000,000,000
DATA 000,000,000,000,000,020,020,000,000,000
DATA 000,000,000,000,020,020,022,020,000,000
DATA 000,000,000,020,022,022,022,022,022,000
DATA 000,000,000,020,022,025,022,025,019,000
DATA 000,000,020,022,025,019,022,025,019,022
DATA 000,020,022,022,025,019,022,022,025,019
DATA 000,020,022,025,019,019,022,025,025,019
DATA 000,000,020,019,019,019,019,019,019,019

DATA 255,255,255,255,255,255,255,255,255,255
DATA 255,255,255,255,255,255,255,255,255,255
DATA 255,255,255,255,000,020,020,255,255,255
DATA 255,255,255,000,020,020,022,020,255,255
DATA 255,255,000,020,022,022,022,022,022,255
DATA 255,255,000,020,022,025,022,025,019,255
DATA 255,000,020,022,025,019,022,025,019,022
DATA 000,020,022,022,025,019,022,022,025,019
DATA 000,020,022,025,019,019,022,025,025,019
DATA 255,000,020,019,019,019,019,019,019,019


thats a sprite of a rock . it's most likely different for vb6 or true basic so yeah look it up

Image Edited by the Author.

 
n/a

Dalal



Registered
  28/03/2004
Points
  307
26th April, 2006 at 16:48:39 -

I'll probably just make the background of my game a solid color so that I don't have to worry about transparency.

Okay, here's another question I have:

I got the Keypress thing to work in True Basic, but it gives me the same result as:

do
if key input then
get key pressed
print pressed
end if
loop


Isn't there a way I can get it just like MMF's "Repeat While Key Is Pressed" condition? So that it detects while a key is down or being held down, and it repeats an event while this is true. Please help!

Thanks,
Dalal

Image Edited by the Author.

 
.bin there done .dat

DanielRehn



Registered
  18/09/2002
Points
  139
26th April, 2006 at 17:49:42 -

I'm no expert.. but if there's a keydown/keyup function you could save the state into a boolean value...

 
n/a

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
26th April, 2006 at 17:51:52 -

Yes, use keydown and keyup (if its anything like Visual Basic)

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
26th April, 2006 at 19:09:11 -

Err, shouldn't that be the KeyDown event?

 
Craps, I'm an old man!

DanielRehn



Registered
  18/09/2002
Points
  139
26th April, 2006 at 22:44:26 -

True! OnKeyDown, change the boolean value to true, OnKeyUp change it to false...
If boolean value is true do the stuff, otherwise not... There you go.. a homemade repeat while key is pressed routine...

 
n/a

Dalal



Registered
  28/03/2004
Points
  307
27th April, 2006 at 15:37:07 -

Exactly, that's what I was thinking, but how do I do KeyUp and KeyDown in True Basic? I don't think there's a way... But I'll do some more research. Geez, True Basic is getting on my nerves. How the heck do you test for KeyUp KeyDown!!!

Anybody know the syntax for KeyUp/KeyDown for QBasic or Visual Basic? I'll experiment with them and see if I can get it to work in True Basic? At least for QBasic or just plain old Basic, because those languages are the closest to True Basic.

Thanks,
Dalal

Image Edited by the Author.

 
.bin there done .dat

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
28th April, 2006 at 04:23:04 -

I don't know jack about basic, but if you can to ontick-type events you could make it register a downkey event, and repeatedly check for it.


in a klik-style program it would look like


o-User presses right
+-every .01 seconds
=Set X pos "Mario" (X pos mario + 4")
Or something like that.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
7th May, 2006 at 15:52:01 -

That was obvious, bibcake.

 
n/a

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
8th May, 2006 at 07:57:44 -

Not sure this is relevant, but try taking a look at http://advsys.net/ken/ . It's the homepage of the guy who made the engine for Duke Nukem 3D. Among other things, already in 1994 he made a 3D engine in Qbasic lots of other cool stuff on there.

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
21st May, 2006 at 01:36:58 -

This link is for a "Mario-Type" game coded in qbasic. dunno if it'll help or not

http://www.qbasic.com/classic/files/worms.zip

Dont bother. it dont work. it displays "IT STARTS" and then crashes. unless you can edit code then its naff

Image Edited by the Author.

 
n/a

vortex2



Registered
  27/05/2002
Points
  1406
21st May, 2006 at 04:04:16 -

Your entire approach is wrong:

A) You shouldn't copy a game idea
B) You shouldn't take someone elses code and say that you wrote it in a programming class
C) You shouldn't be using Basic .

 
A bit of insanity with every bite!

machrider



Registered
  25/06/2006
Points
  121
10th July, 2006 at 21:18:29 -

Oh god, I took programming in highschool and they made me use that POS program too. I failed the class and I never tried to learn a programming langauge since. I don't even think it can make games. Most of the time we spent in the class was making dumb programs that calcuated the sum of things. You know, programs that take all the variables you programmed and displayed something like "Mary has 8 apples" or some prompt followed by "YOUR NAME IS (name)" and other stuff like that. We didn't do much else in the class. There was a very basic session on how to draw circles and lines but that was pretty much it.

Image Edited by the Author.

 
n/a

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
11th July, 2006 at 08:11:11 -

Hey, be glad you never had to learn PASCAL. Bleh!

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Nova Soft



Registered
  16/10/2005
Points
  427
12th July, 2006 at 13:36:07 -

Quick Basic rules all programming languages, motherfuckers. Those who slander it have obviously never explored it and witnessed what it's actually capable of. It's especially impressive considering its age.

http://en.wikipedia.org/wiki/QBasic

 
By a route obscure and lonely,
Haunted by ill angels only,
Where an Eidolon, named night,
On a black throne reigns upright,
I have reached these lands but newly
From an ultimate dim Thule
From a wild clime that lieth, sublime,
Out of space
Out of time.

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
12th July, 2006 at 13:39:04 -

QBasic != QuickBASIC.

 
n/a

machrider



Registered
  25/06/2006
Points
  121
12th July, 2006 at 15:39:03 -

Yeah, the thing is the class I went to was supposed to be a QBasic class but they switched to True Basic (which i might add looks like a windows 3.1 program) because QBasic runs in DOS instead of windows. I would of loved learning Qbasic, at least that can make games. I'm not too sure about True Basic. I don't mean to discourage you or anything, there's a possibility it can be done but from what I've seen of the program i don't know.

 
n/a

Dalal



Registered
  28/03/2004
Points
  307
21st July, 2006 at 16:26:56 -

Yes! I finished the game. I couldn't ever get the Repeat While Key is Pressed thing to work but 'True Mario' turned out to be pretty fun nevertheless.

 
.bin there done .dat
   

Post Reply



 



Advertisement

Worth A Click