+- +-

User

Welcome, Guest.
Please login or register.
 
 
 

Login with your social network

Forgot your password?

Stats

Members
Total Members: 8
Latest: Dilamon Saravi
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 146
Total Topics: 52
Most Online Today: 2
Most Online Ever: 303
(September 12, 2023, 04:34:39 pm)
Users Online
Members: 0
Guests: 1
Total: 1

Recent Posts

Pages: 1 ... 5 6 [7] 8 9 10
61
Your Projects / Re: my text adventure
« Last post by OlDosLover on May 07, 2012, 10:09:50 pm »
Hi all,
    Interesting program John. I see this more as an added commentary to an existing graphical program rather than true text based game. Never the less i applaud you for you contribution.
OlDosLover.
62
Ideas / Re: IDEAS
« Last post by axlyon on May 07, 2012, 02:25:29 pm »
the "your projects" section is dedicated to that
63
Ideas / IDEAS
« Last post by MR. Y on May 07, 2012, 01:55:42 pm »
A place on this site for IDEAS

IDEAS (what you want to do) are far far more important and alive than the mere means (programs, tools) to do them.

This site could be the first to discuss ideas more than the mere tools that might do them!
It would be the place to FIND OUT what really interests users most - the games and other things they WISH existed.
Given THAT, we can start creating them!

So send in your ideas - as detailed as possible. Not just "An exciting game" but one that IS exciting BECAUSE of the ideas you have imagined and told us about are making things happen the way you hoped!
64
Your Projects / A text adventure. A fun variant with a few movie graphics
« Last post by MR. Y on May 04, 2012, 04:29:29 am »
Here is a little prog that is a word adventure with a little graphics

It foretells the end of the world.

The nice thing is the words are so easily changed to whatever you want!
So you can have fun there.
Also the only thing needed for the graphics is every heavenly body accelerates as the mass of the nearby bodies divided by distance squared.
So you can try other gravity rules if you like!
And it ends in a ginormous explosion (end of the world) which you can design yourself!

This prog should be run on plain old QBAS
Run it on QB64 and you will need to slow it down enough to read the comments. All good practice at seeing that you CAN change what a prog does and how fast it does it.

Copy this into a prog that runs QBAS and hit run:


Code: [Select]
CLS
SCREEN 12
DIM m$(40)
VIEW (0, 0)-(639, 479)
WINDOW (-5, -5)-(5, 5)
RANDOMIZE TIMER
FOR x = 1 TO 500
PSET (10 * RND - 5, 10 * RND - 5), 7
NEXT
PSET (0, 0), 14
i = 0: n = -1: iseen = 10000: da = 1: db = 1: dc = 1: colb = 2

REM orbits of heavenly bodies.  Names are a, b, c, ..........
REM a has mass 10 and starts at x=0, y=0, vx=0, vy=0
ma = 10: xa = 0: ya = 0: vxa = 0: vya = 0
REM b has mass 1 and starts at x, y, with velocity vb
REM c has mass 3 and starts at xc, yc, with velocity vc
mb = 1: xb = -.55: yb = 0: vxb = 0: vyb = -4
mc = 3 - .00001: xc = -3.3065: yc = -6: vxc = -.532: vyc = -.12
vxa = -vxb / 10: vya = -vyb / 10
dabo = SQR((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb))

m$(1) = "Earth in orbit round sun"
m$(2) = "Green and Pleasant Land:  365 days a year:  65 deg F"
m$(20) = "Dawn of a new  Ice  Age?"
m$(21) = "Earth is an arid desert!"
m$(3) = "January 2017   ALERT: Earth orbit is shifting!"
m$(4) = "March 2017  Suspect massive comet is approaching"
m$(5) = "October 2017 Radio telescopes detect massive comet"
m$(6) = "December 2017 Government denies  existence of comet"
m$(17) = "Wall Street Panic!  "
m$(7) = "UK and US stock collapse:  Many suicides"
m$(8) = "Sinners Repent:    The End draws Nigh"
m$(9) = "Computations predict impact with Earth"
m$(11) = "Watch my lips: there is no comet (US President)"
m$(10) = "  Comet visible in night sky"
m$(12) = "Comet visible in broad daylight"
m$(13) = " Comet turns night to day                       "
m$(14) = "     Comet brighter than sun   "
m$(15) = "Days this year "
m$(16) = "Mean day temp "
tnt = .00274
tint = tnt
WHILE INKEY$ = ""
i = i + 1

REM distance a from b:-   dabsquared=dxsquared+dysquared
dxabsq = (xa - xb) * (xa - xb): dyabsq = (ya - yb) * (ya - yb)
dabsq = dxabsq + dyabsq
dab = SQR(dabsq)
REM acceleration of a due to b:  (its really accn/dab)
fab = -1 / (dabsq * dab)
fxab = fab * (xa - xb)
fyab = fab * (ya - yb)

REM acceleration of b due to a:
fxba = -fxab * ma
fyba = -fyab * ma

REM acceleration of a due to c:
REM distance a from c:-   dacsquared=dxsquared+dysquared
dxacsq = (xa - xc) * (xa - xc): dyacsq = (ya - yc) * (ya - yc)
dacsq = dxacsq + dyacsq
dac = SQR(dacsq)
REM acceleration of a due to c:  (its really accn/dac)
fac = -mc / (dacsq * dac)
fxac = fac * (xa - xc)
fyac = fac * (ya - yc)

REM acceleration of c due to a:
fxca = -fxac * ma / mc
fyca = -fyac * ma / mc

REM acceleration of b due to c:
REM distance b from c:-   dbcsquared=dxsquared+dysquared
dxbcsq = (xb - xc) * (xb - xc): dybcsq = (yb - yc) * (yb - yc)
dbcsq = dxbcsq + dybcsq
dbc = SQR(dbcsq)
REM acceleration of b due to c:  (its really accn/dbc)
fbc = -mc / (dbcsq * dbc)
fxbc = fbc * (xb - xc)
fybc = fbc * (yb - yc)

REM acceleration of c due to b:
fxcb = -fxbc / mc
fycb = -fybc / mc

dvxa = (fxab + fxac) * tint
dvya = (fyab + fyac) * tint
dvxb = (fxbc + fxba) * tint
dvyb = (fybc + fyba) * tint
dvxc = (fxca + fxcb) * tint
dvyc = (fyca + fycb) * tint
vxa = vxa + dvxa
vya = vya + dvya
vxb = vxb + dvxb
vyb = vyb + dvyb
vxc = vxc + dvxc
vyc = vyc + dvyc
xa = xa + vxa * tint
ya = ya + vya * tint
xb = xb + vxb * tint
yb = yb + vyb * tint
xc = xc + vxc * tint
yc = yc + vyc * tint

PSET (xa, ya), 14
PSET (xb, yb), colb
PSET (xc, yc), 12
FOR iiy = 1 TO 300000: NEXT iiy' waste time

IF i > 3.5 * 184 THEN GOTO nxt
IF i < 3 THEN PRINT m$(i)
IF i = 1 * 184 THEN LOCATE 4, 1: PRINT m$(3)
IF i = 230 THEN PRINT m$(4)
IF i = 2 * 184 - 42 THEN PRINT m$(5)
IF i = 3 * 184 - 42 THEN PRINT m$(7)
IF i = 2 * 184 + 12 THEN PRINT m$(17)
IF i = 2 * 184 - 2 THEN PRINT m$(6)
IF i = 3 * 184 THEN PRINT m$(9)
IF i = 3 * 184 + 80 THEN PRINT m$(8)
nxt:
IF i = n * 184 THEN LOCATE 2, 27: PRINT m$(15); FIX(365 * dab / dabo); : n = n + 1: GOSUB temp: LOCATE 2, 48: PRINT m$(16); temp; " deg F"
IF da THEN IF dac < 6 THEN LOCATE 3, 1: PRINT m$(10): iseen = i: da = 0
IF i = iseen + 6 THEN LOCATE 11, 1: PRINT m$(11)
IF dc THEN IF dac < 4 THEN PRINT m$(12): dc = 0: n = FIX(i / 184) + 1:
IF dc THEN IF dbc < dab THEN PRINT m$(14)
IF db THEN IF dbc < 2 THEN LOCATE 4, 1: PRINT m$(13): db = 0
IF dbc < .02 THEN LOCATE 10, 57: PRINT "comet imapacts earth": GOTO earthend
IF dac < .07 THEN LOCATE 11, 57: PRINT "comet impacts sun": GOSUB bang
IF i = 0 THEN LOCATE 1, 57: PRINT "Dawn of New Millenium?";
IF 1 = 2 * 184 THEN LOCATE 2, 57: PRINT "1 January 2017"
IF 1 = 5 * 184 THEN : LOCATE 3, 57: PRINT "End of the World?": GOSUB blank
'IF i = 1 THEN PRINT m$(1)
'IF i = 1 THEN PRINT m$(1)
'IF i = 1 THEN PRINT m$(1)
' LOCATE 2, 60: PRINT 10 * (vxa ^ 2 + vya ^ 2) + vxb ^ 2 + vyb ^ 2 + 3 * (vxc ^ 2 + vyc ^ 2)

WEND


SCREEN 0
STOP
temp:
temp = FIX(135 * dabo / dab - 70)
IF temp < 0 THEN colb = 3: LOCATE 2, 1: PRINT m$(20)
IF temp > 200 THEN colb = 6: LOCATE 2, 1: PRINT m$(21)
RETURN

blank:
LOCATE 4, 1
PRINT "                                                   "
PRINT "                                                   "
PRINT "                                                   "
PRINT "                                                   "
RETURN

bang:
FOR u = 1 TO 100 STEP .123
PSET (xa + .004 * u * COS(u), ya + .004 * u * SIN(u)), 15 - .1 * u
NEXT
xc = xa: yc = ya + .1
vxa = -vxb * mb / (mc + ma): vya = -vyb * mb / (mc + ma)
dvc = (3.2 + .55 * RND) * SQR(ma): vxc = vxa - dvc: vyc = vya: vxa = vxa + dvc * mc / ma
RETURN

earthend:
FOR u = 1 TO 2000 STEP .0455
PSET (xb + .004 * u * COS(u), yb + .004 * u * SIN(u)), 15 - .01 * u
NEXT

SUB blank
PRINT
PRINT
PRINT
PRINT


END SUB


[edit by axlyon. "was that so hard?"]
65
Yes good old Pythagoras will help us!
Distance is sqrt(widthsquared  + heightsquared)
But be warned that pixel count may not be inches!(nor cm)

What I really plan to do is COMPARE two pictures
Let us call them Right Eye picture and Left Eye picture
(I have a webcam with two eyes spaced like a human being)
So just like our brain does, we can calculate the full 3-d image (x,y,z pixel list) by COMPRING the two views
The human eye-brain actually does wondrous things that way and gets much BETTER RESOLUTION than can be resolved by either eye (retina) alone! They call it "optical disparity"
66
Tutorials / Re: Start of a Graphics Tut
« Last post by MR. Y on May 01, 2012, 12:29:27 pm »
Great tut, Oldos

One thing though, what you SEE on screen is not exactly what "gets computed"
There is quite a bit on qb64 abt this - under the questions raised "Why don't I see a square picture?"

It seems the computer makes a picture that has a given width IN PIXEL COUNT but your monitor may have *not square " pixels and other ideas about pictures, as well as be adjustable for width and height.
Also (because they are cheaper to make) popular screens these days are 2 x 1 and NOT the 4 x3 of earlier days - so your pictures get stretched widthwise!

The only escape is to know quite a bit about the monitor screen that is going to be used - escpecially if you plan to send pictures to people whose monitor is not known to you!
67
OK here it is: qb64 version

'When you don't have an equation it is more difficult!
'suppose your height (potential) data comes like this in data statements
DIM x(50), y(50), z(100), E(50), h(640, 480)
DATA 322,240,11
DATA 160,160,9
DATA 80,80,6
DATA 144,40,3
DATA 235,144,4
DATA 356,248,7
DATA 280,347,9
DATA 387,77,13
DATA 130,230,12
DATA 270,120,9
DATA 360,320,8
DATA 140,270,11
DATA 530,300,6
DATA 450,110,2
DATA 380,370,12
DATA 270,270,10
DATA 999,0,0
zstart = 999
' now plot the data in colour
SCREEN 12
WINDOW (0, 0)-(639, 479)
_FULLSCREEN
readmore: i = i + 1
READ x(i)
IF x(i) = 999 THEN n = i - 1: GOTO endread
READ y(i), z(i)
CIRCLE (x(i), y(i)), 2, z(i)
ztot = ztot + z(i)
GOTO readmore
endread:
zmean = ztot / n
wo = 640 * 480 / n
w = .5 * 640 * 480 / n
PRINT "zmean="; zmean

LOCATE 15, 5
PRINT "key": PRINT 1: PRINT 2: PRINT 3: PRINT 4: PRINT 5: PRINT 6
PRINT 7: PRINT 8: PRINT 9: PRINT 10: PRINT 11: PRINT 12: PRINT 13: PRINT 14: PRINT 15
FOR nn = 1 TO 15
    LINE (22, 199 + 15.7 * (5 - nn))-(44, 199 + 15.7 * (5 - nn)), nn
NEXT nn

LOCATE 1, 1: PRINT "To plot the contour lines hit any key now"
here: a$ = INKEY$
IF a$ = "" THEN GOTO here
t = TIMER
FOR i = 1 TO n
    E(i) = z(i) - zmean
NEXT i

FOR jj = 1 TO 9 * n '160 'find max error point
    emax = 0
    FOR i = 1 TO n
        IF ABS(E(i)) > emax THEN emax = ABS(E(i)): ii = i
        k = E(ii)
    NEXT i
    'fixit
    FOR i = 1 TO n
        dsq = (x(i) - x(ii)) * (x(i) - x(ii)) + (y(i) - y(ii)) * (y(i) - y(ii))
        E(i) = E(i) - k * EXP(-(dsq / w))
        IF i <> ii THEN GOTO hop
        FOR x = 1 TO 639
            FOR y = 1 TO 479
                dsq2 = (x - x(ii)) * (x - x(ii)) + (y - y(ii)) * (y - y(ii))
                h(x, y) = h(x, y) + k * EXP(-(dsq2 / w))
            NEXT y
        NEXT x
        hop:
    NEXT i
NEXT jj

FOR x = 1 TO 639
    FOR y = 1 TO 479
        col = h(x, y) + zmean
        CIRCLE (x, y), 2, col
    NEXT y
NEXT x
'LOCATE 28, 1:
'PRINT w / wo, TIMER - t

FOR i = 1 TO n
    CIRCLE (x(i), y(i)), 3.2
    CIRCLE (x(i), y(i)), 2, z(i)
    PAINT (x(i), y(i)), z(i)
NEXT i
LOCATE 17, 3
PRINT "key": PRINT: PRINT 2: PRINT 4
PRINT 6: PRINT 8: PRINT 10: PRINT 12: PRINT 14
FOR nn = 1 TO 15
    LINE (22, 161 + 8 * (5 - nn))-(44, 161 + 8 * (5 - nn)), nn
    LINE (22, 160 + 8 * (5 - nn))-(44, 160 + 8 * (5 - nn)), nn
    LINE (22, 159 + 8 * (5 - nn))-(44, 159 + 8 * (5 - nn)), nn
    LINE (22, 158 + 8 * (5 - nn))-(44, 158 + 8 * (5 - nn)), nn
    LINE (22, 157 + 8 * (5 - nn))-(44, 157 + 8 * (5 - nn)), nn
    LINE (22, 156 + 8 * (5 - nn))-(44, 156 + 8 * (5 - nn)), nn
NEXT nn
END
68
Tutorials / Start of a Graphics Tut
« Last post by OlDosLover on May 01, 2012, 09:18:37 am »
Hi all,
    Here's the start of a graphics tutorial comparing the QBasic ideas to the new QB64 ideas. Criticisms and ideas welcomed.
Quote
                  QB64 GRAPHICS
   Welcome to this tutorial. Here i will attempt to help the newcommer understand the legacy QBasic graphics
ideas compared to the new QB64 graphic commands and how to use them. I will use some terms to describe things and
define these terms next.

TERMS
   Legacy = QBasic or QB45
   QB64 = The new underscored keywords
   Graphic surface = a set sized screen of pixels at a certain amount of colours
   Pages = a number of associated graphic surfaces all the same size and colour depth
   Colour Depth = maximum number of colours that can be displayed on a graphics surface
   Statement = a BASIC keyword used to invoke a command with correct parameters
   Monitor = computer screen
   Mode = a particular legacy screen
   Handle = Identifing label (a name)


LEGACY SCREEN's
   In the old DOS QBasic a user could only create fixed legacy screens in size and colour depth. In QBasic a
user would create this one graphic window by using the statement SCREEN with a number. For example the main graphic
screens that QBasic could create are:

SCREEN 7
SCREEN 9
SCREEN 12
SCREEN 13

   The resolutions of these old screens are:

SCREEN 7   320 x 200 x 16 colours      at 4 pages   
SCREEN 9   640 x 350 x 16 colours      at 2 pages   
SCREEN 12   640 x 480 x 16 colours      at 1 page
SCREEN 13   320 x 200 x 256   colours      at 1 page

   When the programmer creates one of these screens one does it by invoking the SCREEN statement with the
desired screen number. It is immediately created and made visual , so its seen. On todays modern computer monitors
that have huge resolutions these old screen will appear to be very small. Never the less they can be made to fill
the entire monitor screen by using the keyboard command ALT + ENTER.


QB64 SCREEN's

   The programmer can still use the above QBasic syntax of creating a screen or use the QB64 only _NEWIMAGE.
   Newimage allows the user to create a graphic surface. This surface has a horizontal size and a vertical
size and a colour depth.
   The colour depth is indicated by using the legacy MODE number (0,1,2,7,8,9,10,11,12,13) or stateing the
colour depth as 256 or 32.
   The programmer indicates the horizontal pixel size , the vertical pixel size and the number of colors with
the arguments in the statement declaration.
For legacy screens the programmer indicates the color depth by using the Screen number (Mode) as the colour depth
variable. To create the same legacy screen with the _NEWIMAGE command the user would do:

Handle& = _NEWIMAGE(640,480,7)   'Legacy QBasic Screen 7
Handle& = _NEWIMAGE(640,480,9)   'Legacy QBasic Screen 9
Handle& = _NEWIMAGE(640,480,12)   'Legacy QBasic Screen 12
Handle& = _NEWIMAGE(640,480,13)   'Legacy QBasic Screen 13



   The HANDLE& is either the keyword SCREEN or a variable name composed by the author. Here are two examples:

SCREEN  _NEWIMAGE(640,480,12)      'immediately create and make visable
GraphicSurface& = _NEWIMAGE(640,480,12)   'immediately create but is not visable

   Whats the differences? When the SCREEN statement is used as in the first example QB64 immediately creates a
640 pixel wide by 480 pixel deep with Legacy SCREEN 12 size at 16 colours and makes it immediately visable on the
users computer monitor. When the user creates a surface with a Handle name QB64 allocates a negative number that
isnt in use to identify the identity of that surface. Secondly QB64 immediately creates a 640 pixel wide by 480
pixel deep with 16 colours surface. It does not make this surface visable. Which means that it exists and is
located in memory but is not actually shown.
   Interestingly the user can use the print statement on this surface to display the negative number assigned
to that surface. Please note that the number   -1 (negative one) is reserved to indicate that an error has occured.
So if your Surface is -1 then it isnt created! and carnt be used. So how would the user do this to illustrate the
handle number? Like this example

REM
GraphicSurface& = _NEWIMAGE(640,480,16)   'create the equivalent Legacy Screen 12
SCREEN  GraphicSurface&         'make this Surface visable
PRINT GraphicSurface&         'print the surfaces handle number
SLEEP
SYSTEM

   So the user can replicate the older DOS graphic screens but what about newer sized screens? Well with
_NEWIMAGE the user can create any sized screen that they desire with 32 bit colours. This screen can be 8 pixels
square up to 1000's of pixels square! Now even though you can make a 2,500 pixel screen the average computer
monitor can not show the entire surface on the screen. What you will see is part of the screen. If you use your
mouse cursor to click on the title bar of this screen and hold the button down you can slide it sideways to see its
complete size. The user is better off using standard sizes that most monitors can display like full screen monitor
resolutions.
OlDosLover.
69
Hi all,
    John the above program. Did you want to work more on it? I was thinking that once the "line" is drawn (the start and end pixels are recorded) we could compute the line length by treating the line as the diagonal line of a triangle. If the drawn line is vertical or horizontal then computing in pexels is linear or so it would seem to me?
    Any thoughts?
OlDosLover.
70
General Discussion / Re: my blog
« Last post by axlyon on May 01, 2012, 06:38:10 am »
URL= web address. not sure who or how they came up with it
Pages: 1 ... 5 6 [7] 8 9 10

+-Recent Topics

Excelling in C++: Trust the Professional Code Experts at MyCodingHomework for Expert Homework Assistance by Dilamon Saravi
June 05, 2023, 08:02:21 am

Make money online: 4 Reasons Why Blockchain Gaming is The Future by Damingw
March 06, 2023, 05:51:43 am

Fairy Cat, New Profitable Blockchain Game by claude william
March 01, 2023, 11:30:54 pm

GameFi - A way out for low-skilled workers by claude william
February 28, 2023, 11:29:57 pm

The History of Gaming — From Pay-to-Play to Play-to-Earn by claude william
February 27, 2023, 11:50:57 pm

Best Blockchain Games by claude william
February 26, 2023, 11:46:46 pm

3 Best Blockchain Games to Invest In 2023 by claude william
February 25, 2023, 11:16:23 pm

The History of Gaming — From Pay-to-Play to Play-to-Earn by claude william
February 24, 2023, 11:57:47 pm

Best Play-to-Earn Games with NFTs or Crypto by claude william
February 24, 2023, 12:04:48 am

A few lines of fun writing to IT brothers during Covid by claude william
February 22, 2023, 11:35:56 pm