Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
xadj and yadj?
#1
What does xadj and yadj mean?

here is where I found that command at

-----------------------------------------------------------------------------------
SCREEN 13
x = 50: Y = 50
x2 = 200: y2 = 100
xadj = .1: yadj = .1
DO
press$ = INKEY$
WAIT &H3DA, 8

LINE (x - 8, Y - 8)-(x + 8, Y + 8), 0, BF
CIRCLE (x, Y), 6, 5
LINE (x2, y2)-(x2 + 3, y2 + 3), 1, BF
LOCATE 1, 1: PRINT score

IF press$ = "a" THEN x2 = x2 - 2
IF press$ = "d" THEN x2 = x2 + 2
IF press$ = "s" THEN y2 = y2 + 2
IF press$ = "w" THEN y2 = y2 - 2

IF Y <= 0 THEN yadj = .5
IF Y >= 200 THEN yadj = -.5
IF x >= 320 THEN xadj = -.5
IF x <= 0 THEN xadj = .5
IF x > x2 AND x < x2 + 20 AND Y > y2 AND Y < y2 + 20 THEN : score = score + 1

IF score = 1000 THEN : PRINT "good score!"
IF score = 2500 THEN : PRINT "great!"
IF score = 5000 THEN : PRINT "wow!"

IF score = 10000 THEN
FOR i = 1 TO 100
PRINT "max score!!!"
NEXT
END
END IF

x = x + xadj
Y = Y + yadj
LOOP UNTIL press$ = "q"
-----------------------------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~

I love Quick Basic better then Python...

And Python is new.........

Oh yea catch ARPGME
Reply
#2
They mean "x-adjacent" and "y-adjacent". If something is adjacent to an object, it is connected to the object.
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)
Reply
#3
Huh? It looks like xadj and yadj are supposed to be velocities for that purple ball, like "x adjust" and "y adjust". The ball moves around with velocity xadj and yadj while the the user controls the blue blocks like an etch-a-sketch.
Reply
#4
yeah, x and y are changed by how much is in xadj and yadj, every time through the loop. so every loop, x and y will change (be adjusted ;) by .5

the way it actually works inside that prog, is when a left or top boundary has been hit, the adj is positive making it move right (x-axis) or down (y-axis)

for instance: 20,100

if you add one to the x-axis: 21, 100, that means it moved to the right by one.

so, as i said when a left or top boundary has been hit (0's in x or y axis) the adjust becomes positive. when the other boundary has been hit (320 on x, and 200 on y), the adjust becomes negative.

then, the adjust is added to the x, y. so if its positive, the value will go up, and if its negative, the value will go down :)
Reply
#5
:lol: I use... X = X + XV and Y = Y + YV... V for Verb, Action Verb that is.. :rotfl: ... Or X-Velocity, Y-Velocity... :wink: .. Either way.. Smile

I used to think of ADJ as adjective or something like that.. lol,. X's Adjective to get to, Y's adjective to get to.. :roll: :wink:
Kevin (x.t.r.GRAPHICS)

[Image: 11895-r.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)