SCREEN _NEWIMAGE(800, 600, 13) DO IF x + mx > 774 THEN mx = -3 ELSE IF x + mx < 25 THEN mx = 3 IF y + my > 574 THEN my = -3 ELSE IF y + my < 25 THEN my = 3 x = x + mx y = y + my CIRCLE (x, y), 25, 40 PAINT (x, y), 40 _DISPLAY _LIMIT 100 CLS LOOP UNTIL LEN(INKEY$) Bam! 12 liner!
+Newborn Kid (TheKidNew) -- There are some differences between your program and mine. Your program: Has a 320x200 LEGACY 4-bit color screen; Doesn't fill the ball with color; Doesn't check for Y collision if X collision has been detected; Uses PCOPY instead of _DISPLAY (and thus, in turn, uses pages); Uses a green ball (Not that it matters, but I was trying to replicate SchoolFreeware's ball program); Allows part of the ball to go off-screen; Has FOURTEEN lines of code, not NINE. You cheated by adding colons. My program: Uses a customized 800x600 8-bit color screen; Has a ball that resembles the one shown in the video; Checks for both X and Y collision no matter the condition of one; Uses certain numbers that allows the ball to bounce, and not clip, off of the screen; Has a higher framerate (100 FPS) and yours is limited (you didn't use _DISPLAY); Doesn't set a starting point for the ball (X and Y are 0); Has 12 lines of code. Another problem with yours, is that X and Y often have collision at the same time, so X gets reversed, Y doesn't, and the program gets passed along. This causes Y to equal -1, and every time Y collision is detected, Y would flip between 0 and -1, causing the ball to appear to stay inside the ceiling. This continues until X is 0, collision isn't detected in Y, and the ball is freed. Bouncing off corners is glitched.
SCREEN _NEWIMAGE(800, 600, 13) DO IF x + mx > 774 THEN mx = -3 ELSE IF x + mx < 25 THEN mx = 3 IF y + my > 574 THEN my = -3 ELSE IF y + my < 25 THEN my = 3 x = x + mx y = y + my CIRCLE (x, y), 25, 40 PAINT (x, y), 40 _DISPLAY _LIMIT 100 CLS LOOP UNTIL LEN(INKEY$) Bam! 12 liner!
you could've made it shorter SCREEN _NEWIMAGE(800, 600, 32) ball = _LOADIMAGE("ball3.png") x = 0: y = 0: Xmovement = 1: Ymovement = 1 DO _LIMIT 600 PCOPY _DISPLAY, 1 x = x + Xmovement y = y + Ymovement _PUTIMAGE (x, y), ball _DISPLAY PCOPY 1, _DISPLAY IF x >= 799 - 50 OR x = 599 - 50 OR y
30 years ago, this was mind-blowing. (Pong, anyone?) Now, it's super simple, depending on a person's skills.
Very nice, I like it.
Thank you, on this principle, I just wrote a screensaver.
can you explain pcopy display
Is it necessary to use declare image as long are can we declare it as an integer or double or single too?
You have told how to insert a picture, now can you tell how to remove a picture?
I dont get the pcopy stuff
why do you need this Moveup & -right variable extra here?
Its used to check the acceleration direction and change accordingly
That is pretty cool
U R AWESOME
U R AWESOME
WOAHHHHHHHH
WOAHHHHHHHH
SCREEN _NEWIMAGE(800, 600, 13)
DO
IF x + mx > 774 THEN mx = -3 ELSE IF x + mx < 25 THEN mx = 3
IF y + my > 574 THEN my = -3 ELSE IF y + my < 25 THEN my = 3
x = x + mx
y = y + my
CIRCLE (x, y), 25, 40
PAINT (x, y), 40
_DISPLAY
_LIMIT 100
CLS
LOOP UNTIL LEN(INKEY$)
Bam! 12 liner!
+CreeperGabe
SCREEN 7, , 0, 1
x = 100 : y = 100 : xs = 1 : ys = 1
DO
_Limit 220
x = x + xs : y = y + ys
IF x >= 320 OR x = 200 OR y
+Newborn Kid (TheKidNew) -- There are some differences between your program and mine. Your program: Has a 320x200 LEGACY 4-bit color screen; Doesn't fill the ball with color; Doesn't check for Y collision if X collision has been detected; Uses PCOPY instead of _DISPLAY (and thus, in turn, uses pages); Uses a green ball (Not that it matters, but I was trying to replicate SchoolFreeware's ball program); Allows part of the ball to go off-screen; Has FOURTEEN lines of code, not NINE. You cheated by adding colons. My program: Uses a customized 800x600 8-bit color screen; Has a ball that resembles the one shown in the video; Checks for both X and Y collision no matter the condition of one; Uses certain numbers that allows the ball to bounce, and not clip, off of the screen; Has a higher framerate (100 FPS) and yours is limited (you didn't use _DISPLAY); Doesn't set a starting point for the ball (X and Y are 0); Has 12 lines of code. Another problem with yours, is that X and Y often have collision at the same time, so X gets reversed, Y doesn't, and the program gets passed along. This causes Y to equal -1, and every time Y collision is detected, Y would flip between 0 and -1, causing the ball to appear to stay inside the ceiling. This continues until X is 0, collision isn't detected in Y, and the ball is freed. Bouncing off corners is glitched.
Gabriel Miceli
I know it, but is easier to understand.
SCREEN _NEWIMAGE(800, 600, 13)
DO
IF x + mx > 774 THEN mx = -3 ELSE IF x + mx < 25 THEN mx = 3
IF y + my > 574 THEN my = -3 ELSE IF y + my < 25 THEN my = 3
x = x + mx
y = y + my
CIRCLE (x, y), 25, 40
PAINT (x, y), 40
_DISPLAY
_LIMIT 100
CLS
LOOP UNTIL LEN(INKEY$)
Bam! 12 liner!
Why do you need mx & my here? why doesn´t it work like this way- IF x > 774 THEN x =x -3 ELSE IF x < 25 THEN x =x+ 3 and so on.....
you could've made it shorter
SCREEN _NEWIMAGE(800, 600, 32)
ball = _LOADIMAGE("ball3.png")
x = 0: y = 0: Xmovement = 1: Ymovement = 1
DO
_LIMIT 600
PCOPY _DISPLAY, 1
x = x + Xmovement
y = y + Ymovement
_PUTIMAGE (x, y), ball
_DISPLAY
PCOPY 1, _DISPLAY
IF x >= 799 - 50 OR x = 599 - 50 OR y
Why not 749 instead of 799 - 50