Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
quite a few questions...
#1
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
Reply
#2
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/tuto...hics.shtml

Good luck!
Reply
#3
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.
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
Reply
#4
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?
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Reply
#5
That's what I use.
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)