Qbasicnews.com
November 15, 2019, 12:35:36 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: quite a few questions...  (Read 2263 times)
Caboose
New Member

Posts: 1


« on: February 16, 2007, 09:45:34 PM »

1) can i post QB programs on the internet?

2) if so, are they browser playable?

3) how do i let people download the file, if i have a website?

4) Im making a platforming game, how would i make my sprite jump?

5) how come this command - LOCATE 160, 100: PRINT "HI!" - dosn't work? what could cause it not to work (using screen 13)

6) when making games, if i don't want a trail to follow the sprite, i use CLS each loop, but then it blinks from CLS-ing, how do i create a solid image?


I know im asking allot, but please, help answer whatever you can
Logged
Radical Raccoon
I hold this place together
*****
Posts: 914



WWW
« Reply #1 on: February 16, 2007, 10:30:22 PM »

Quote
1) can i post QB programs on the internet?

Yes. There are websites that let you submit your program(s). Try Qb45.com.

Quote
2) if so, are they browser playable?

No. QB programs are DOS, and those are hard enough to make playable with modern operating systems. If you want your programs/games to be browser playable, then I suggest you learn Flash and/or Java.

Quote
3) how do i let people download the file, if i have a website?

Upload it to your website. Then place a hyperlink somewhere on your website that links to that file. See http://www.w3schools.com/html/default.asp for more info.

Quote
4) Im making a platforming game, how would i make my sprite jump?

Make a downward velocity variable that increments by a gravity constant each frame. Then when you want the sprite to jump, set its velocity to a negative number, as this will reverse the direction and move the sprite upwards. Since the sprite's velocity is continually incremented by the gravity constant, the sprite will be pulled back down, but make sure to set its velocity back to zero when it hits to ground so that it won't be pulled below it.

Example:
Code:

CONST GRAVITY = 0.98

Player.velocity = Player.velocity + GRAVITY
Player.y = Player.y + Player.velocity

IF Player.y > Floor.y THEN

    Player.y = Floor.y - Player.height '- place the sprite above the ground
    Player.velocity = 0

END IF

'- then if you want your sprite to jump, set Player.velocity to a negative number, like -3 for example. You'll need to adjust this number to reflect the jump height that you want.



Quote
5) how come this command - LOCATE 160, 100: PRINT "HI!" - dosn't work? what could cause it not to work (using screen 13)

Because 160, 100 is beyond the boundaries of the screen. LOCATE works by text position, not pixel position. SCREEN 13 only allows 40 characters width max, and something like 25 height max. So you're text boundaries are (1, 1) to (40, 25).

Quote
6) when making games, if i don't want a trail to follow the sprite, i use CLS each loop, but then it blinks from CLS-ing, how do i create a solid image?

There are two techniques to accomplish this. You can use a graphics library that handles transparency, or sprite masking. There are many QB libraries out there that handle sprite transparency. I recommend that way. Sprite masking is a little more complicated, so I won't go into details about it, but you might want to check out this link: http://www.petesqbsite.com/sections/tutorials/graphics.shtml

Good luck!
Logged

Skyler
Ancient Guru
****
Posts: 564



« Reply #2 on: February 16, 2007, 11:08:44 PM »

Actually Racoon, I think he means eliminating image flicker in animations.
 You need to use pages. There should be a tutorial somewhere around here, but basically you PUT your sprites and stuff on a different page, then copy the page to the screen.
Logged

In the beginning, there is darkness the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Ralph
Ancient Guru
****
Posts: 544


« Reply #3 on: February 17, 2007, 01:56:49 AM »

I have also used two subroutines, one that draws a sprite on the screen, another that draws the sprite to the background color.  Then, just before moving the sprite, I invoke the "erase.Sprite" subroutine, do the incrementation, then invoke the "draw.Sprite" subroutine.  I am less than a master at this, but, it seems to work fine, for me.  Any comments on this?
Logged

Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Skyler
Ancient Guru
****
Posts: 564



« Reply #4 on: February 17, 2007, 10:21:04 AM »

That's what I use.
Logged

In the beginning, there is darkness the emptiness of a matrix waiting for the light. Then a single photon flares into existence. Then another. Soon, thousands more. Optronic pathways connect, subroutines emerge from the chaos, and a holographic consciousness is born." -The Doctor
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!