http://smileboom.com/special/ptcm3/sample/
Click button below title of any to view source code.
Unfortunately not available on English website.
Jump-kun: http://smileboom.com/special/ptcm3/sample/code/game3.php
Sample Programs
HitomiHoshinoCreated:
Hello, just curious, are the example programs that come with SB typed out somewhere? I thought I saw the Japanese ones.
I am considering going through it and examining line by line what the Jump-kun game does and putting notes in it. I tried looking at how it loads maps and there are alot of things it does that I'm not sure why it does it yet.
Excellent, thank you.
Someone should translate this one.
'======ใใฎใใผใใญใฐใฉใ Ver 1,2======= ' ' ใ'ใใใใใใจใงใใญใฐใฉใ ใฏใ'ใใใใฟใใใใฎ ' ใใใฏใใใใฆใฉใใใใใ! ' ใใใใใใใใฏใใฎใใ(ใฟใฉใ)ใซใชใใ! ' ใใชใใทใงใณใใฎใใใใใใใฒใใใใใฏใชใใซใใฆใใใงใญ! ' '============================== ' ใใญใฐใฉใ ใฏใใปใใฆใใซใใใใใใใ ใใซใใใใใใฆใใใใ ACLS '๎ใACLSใใฏใใใใใใใใใใใใใใใใใใใใ ใใ ' ใจใใใใใใพใฏใใกใฐใใฏใใใซใใใฆใใใใ ' X=100:Y=50 '๎XใจYใฏใใฎใกใซใฒใใใใใใใใใใใใฎใใฒใใใใปใใใใฆใใใใ ' ใใใกใใใใใฎใชใใซใปใใใใฆใใใใใ ใ ' ใใใใใฎใใใธใใใใใฃใฆใใใใ ใใ ' A+Bใจใใใธใใใใฉใใใงใใใใใใใใจใใงใใใใ ใ ' ใใญใฐใฉใ ใฏใใใฎใใธใใใใใงใในใฆใชใใใฃใฆใใจใใฃใฆใใใใใใใชใใใ ' ใใปใใฆใใซใใใใใใชใฉใซใคใใใใฆใใชใใใใใชใใใใใคใใฎใใใใงใใคใใใใใ ' ' ใใญใฐใฉใ ใฏใใใใใใใใใใใใฉใใใกใฐใใใใพใงใใฃใฆใใพใใจ ' ใฉใใใSTOPใใฆใใพใใใ ใ ' ใ ใใใใฆใใใใใใใชใใฐใใใฏใใใใฐใใใซใใใใใฉใใฆใใใชใใใฐใชใใชใใ ' '=======ใกใคใณใซใผใ======== '๎ใใฎใใใฎใซใผใใใใฎใใใใใใฏใใพใใ! @MAINLOOP '๎ใ@๎ก๎กใใจใใใใซใใใใใใใชใพใใใคใใใใใ! ' ใใใงใใคใงใใGOTO @๎ก๎กใใจใใใใฐใใฎใใใใซใจใฐใใใจใใงใใใ GCLS:CLS '๎ใGCLSใใฏใฐใฉใใฃใใฏใใใใใฎใใใใใใใCLSใใฏใใใฎใใใใใใ ใใ ' ACLSใฏใใใใใชใปใใใใใใใใใใใกใใใใใใใฏใใใพใใคใใใชใใใ GOSUB @KEISAN '๎ใGOTOใใฏใใฃใใฃใใ ใ ใใฉใGOSUBใใฎใฐใใใฏใพใใใใซใใฉใฃใฆใใใใ ใ GOSUB @HYOUZI ' 100ใใใใใงใใณใ ใใใใใพใใใฉใฃใฆใใใจใ101ใใใใใใใใฃใใใใใใใ ใ ' ใตใใใใฎใฐใใใใใขใฏใปในใงใใใใใซใชใใใ ใใ VSYNC 1 '๎ใใใฏใใใใณใใใใฟใคใใณใฐใพใงใใฉใใใใฆใใใใฆใใใใใใใใใใใ ใใ ' ใใใใชใใจใใใใใกใใคใใใใใใใใฎใใใใงใฒใผใ ในใใผใใใใใใใธใใใใกใใใใ ใ GOTO @MAINLOOP '๎ใใใง25ใใใใใฎใ@MAINLOOPใใซใพใใจใฐใใใ ใใ ' ใใใพใงใใกใคใณใซใผใใใใใใใผใฃใจใฐใซใฐใซใพใใฃใฆใใใใ ' ใงใฏใใฃใใใใใฏใใจใกใ ใใงใใณใ ใใใฆใใตใใซใผใใณใGOSUBใใงใจใใ ใใใฎใใคใใใ ! '===================== ' ' ' '--------------------- ' @KEISAN '๎ใใใใใฏใใใใใใใฎใใฟใงใใใใ ใใใใใตใใซใผใใณใซใใฆใฟใใใ ' CX=CX+0.2 '๎CXใฏใใใฉใใใใถใใใใใฎXใใฒใใใใใใฆใใใใใคใใใฎใใณใซCXใซ0.2ใใคใใใใใฆใใใ IF 40<CX THEN CX=0 ' IF~THENใฏใใใ~ใชใใใจใใใใฟใ ใใใใฎใฐใใใฏใใใCXใ40ใใใใใชใใ๎ใCXใ0ใซใใใ ' B=BUTTON(0) ' ใBUTTONใใฏใใใใใญใผใใใใปใใใใใใใใใใ ใใใใใใใใใใใณในใฆBใซใใใใ IF B AND 1 THEN Y=Y-1 ' 2ใใใใใงใฎใใผใฟใซใชใฃใฆใใใใ ใใฉใใใใ10ใใใใใงใใใฆใใใฆใใใใ IF B AND 2 THEN Y=Y+1 ' 0000 0000 0100 0001 (๎ใใใ1ใคใใคใ1ใใใใ8ใคใง1ใใคใใใฒใ ใใฏ2ใใคใใใใฆใใญ IF B AND 4 THEN X=X-1 ' ใใใใใฐใใใ1ใซใชใใใ ใใใใฎใฐใใใฏ10ใใใใใงใฏ64(X)+1(๎) IF B AND 8 THEN X=X+1 ' ใใ65ใ10ใใใใใใฆใใงใฏ64ใใซใใใใงใใชใใ ' ใใฎใใใฎใใใใฒใใใใใใ(AND)ใใคใใฃใฆใใใ ใใใใง64ใฎใฐใใใ1ใใฉใใใฟใใใใใใใ RETURN '๎ใใฎใใใใใงใGOSUBใใงใใณใ ใใใใใจใฎใฐใใใซใใใใใ ใใใใใใฏ29ใใใใ ' '--------------------- ' @HYOUZI ' ใคใใฏใใฒใใใใใซใใใใใใใใฎใตใใซใผใใณใฎใใคใใใ ใใ ' ใใใใชใใใใใใฟใใใจใฏใใฃใใใฒใใใใใใใ ใใ ใญใ LOCATE CX,20:PRINT "ใใฏใใใใใใพใใ" '๎ใLOCATEใใฏใใใใใใใใใใฎใใใใฎใซใผใฝใซใฎใใกใใใฆใใใฆใใใใX(ใใ),Y(ใใฆ) ' ใใคใใซใผใฝใซใฏใฟใใชใใใฉCLSใใฏ0,0ใซใชใใPRINTใใฏใใใใใใใใฆใใใใฆใใใ LOCATE 0,0 ' ใธใใใใCXใใฎใใใใใใใงใซใผใฝใซใใกใใใใPRINTใใกใใใใฆใใใ ใ PRINT "ใใ ใใใญใผใงใใใใใใใฉใใใใ" '๎PRINTใฏใ?ใใจใใใใจใใงใใ ใ?"ใใใซใกใฏ"ใ PRINT "X=";X,"Y=";Y ' ใ;ใใ ใจใคใฅใใฆใใใใ,ใใ ใจTABใใใใซใชใใใ ใ ' ใ""ใใงใใใฃใฆใชใใใใฏใธใใใใใคใใใใใใใฎใชใใใใใฒใใใใใใใใ GFILL X,Y,X+32,Y+32,RGB(50,100,255) '๎ใใใฏใใใใใใใใใใใใใ ใใใฒใ ใใใใใฟX,YใใฟใใใใใฟใฎX,Yใจใใฃใใใฆใใใใฆใใใ ' RGBใฏRed(ใใ)ใGreen(ใฟใฉใ)ใBlue(ใใ)ใฎใใใถใใฎใใใใงใใใฎ3ใใใใงใในใฆใฎใใใใฒใใใใใงใใใ RETURN '๎ใใใงใGOSUBใใงใใณใ ใใใใใจใฎใฐใใใซใใฉใใใ ใใกใคใณใซใผใใซใใฉใฃใใใVSYNC 1ใใใใฃใใใใใใ '---------------------------------------- 'A=B+(C*30) ใชใฉใใธใใใใฎใคใใใใใฏใใพใใพใงใใ 'A$="ใใใซใกใฏ" ใ$ใใใใกใใใใใใใคใใ ใธใใใใใใใใพใใ 'B$=A$+"ใใใใใใงใใ ใ" '---------- 'ใใปใใฆใใชใใคใใใฏใใใใใงใใ 'ใใใพใงใใใใงใใใฐใใใฃใใใชใใงใใคใใใใฎใงใใ 'ในใใฉใคใใชใฉใใใใปใใฏใใชใใใใใใงใใใจใฏใใฎใคใฉ 'ใใใใใใฒใใใใชใฉใใใคใใใใใชใใใใใใใใใฐใใใ ใใงใใ 'ใใชใใฉใใใงใใใใพใใพใชใใใใใใใใพใใ 'ใใใใใใฃใฆใฟใพใใใใ ' '-------------------' ใใใใใฎใใใใพใใ 'IF A==1 THEN ' ' B=1 ' A =1ใชใB=1ใใใฃใใใใ ' ELSE ' ELSE ' C=1 ' A!=1ใชใC=1ใใใฃใใใใใ 'ENDIF ' (=ใB=1ใใใฃใใใใใชใใฃใใจใใ) '-------------------' ' '-------------------'IFใฎใชใใซIFใใใใใใพใใ 'IF A==1 THEN ' ' IF B==1 THEN 'A=1ใงใใใซB=1ใฎใจใใฎใฟOK!ใใฒใใใ ' PRINT "OK!" ' ' ENDIF ' 'ENDIF ' '-------------------' ' 'ใใใใ(3ใใ ใใใฐใ)ใใฐใใใใGCLS:CLSใใจใใใชใใจ 'ใณใณใฝใผใซใใใใใใใใใซใฉใใใฒใใใใงใใพใใ 'ใCLS:GCLSใใงใฏ๎งใ
I got a bunch of work dumped on me halfway through but I guess here's
'====Beginner Program Ver 1.2===== ' ' By writing a ' before the line ' Text from there will be ignored! ' Ignored text is colored like this ' [Can be configured in the options] ' '================================= ' Programs are processed from the top ACLS '๎ACLS is a command to clear the screen ' Anyway, let us begin writing ' X=100:Y=50 '๎X and Y will be displayed later ' they are storing coordinates ' We're saving a numerical value ' to something called a "variable" ' A+B, would calculate these against ' each other ' It is not an exaggeration to say that programs rely on variables ' Essentially, they are used to store any kind of information ' ' Programs are processed from the top until reaching the end ' When there are no more instructions, they stop. ' If you don't want to stop... we need to prevent the program ' from reaching the end ' '======Main loop======= Our loop code starts here! @MAINLOOP '๎"@XX" we want to give this a meaningful name ' Now anytime you write GOTO @XX it will jump to that line GCLS:CLS '๎GCLS clears the graphics, CLS clears text ' ACLS will reset everything, and we don't want to overuse GOSUB @CALCULATE '๎GOSUB works like GOTO, but we come back here when done GOSUB @DISPLAY ' After the call on line 100, we continue from line 101 ' I can go to mulitple locations VSYNC 1 '๎[The screen waits x/60th of a second before display] ' Prevents the screen from flickering by controlling processing speed GOTO @MAINLOOP '๎Jump back to the "@MAINLOOP" on line 25 ' We will stay in this section of the code, going around and around... ' [ใงใฏใใฃใใใใใฏใใจใกใ ใใงใใณใ ใใใฆใใตใใซใผใใณใGOSUBใใงใจใใ ใใใฎใใคใใใ !] '===================== ' ' ' '--------------------- ' @CALCULATE '๎This subroutine performs operations related to 'calculating' ' CX=CX+0.2 '๎CXใฏใใใฉใใใใถใใใใใฎXใใฒใใใใใใฆใใใใใคใใใฎใใณใซCXใซ0.2ใใคใใใใใฆใใใ IF 40<CX THEN CX=0 ' IF~THENใฏใใใ~ใชใใใจใใใใฟใ ใใใใฎใฐใใใฏใใใCXใ40ใใใใใชใใ๎ใCXใ0ใซใใใ ' B=BUTTON(0) ' ใBUTTONใใฏใใใใใญใผใใใใปใใใใใใใใใใ ใใใใใใใใใใใณในใฆBใซใใใใ IF B AND 1 THEN Y=Y-1 ' 2ใใใใใงใฎใใผใฟใซใชใฃใฆใใใใ ใใฉใใใใ10ใใใใใงใใใฆใใใฆใใใใ IF B AND 2 THEN Y=Y+1 ' 0000 0000 0100 0001 (๎ใใใ1ใคใใคใ1ใใใใ8ใคใง1ใใคใใใฒใ ใใฏ2ใใคใใใใฆใใญ IF B AND 4 THEN X=X-1 ' ใใใใใฐใใใ1ใซใชใใใ ใใใใฎใฐใใใฏ10ใใใใใงใฏ64(X)+1(๎) IF B AND 8 THEN X=X+1 ' ใใ65ใ10ใใใใใใฆใใงใฏ64ใใซใใใใงใใชใใ ' ใใฎใใใฎใใใใฒใใใใใใ(AND)ใใคใใฃใฆใใใ ใใใใง64ใฎใฐใใใ1ใใฉใใใฟใใใใใใใ RETURN '๎ใใฎใใใใใงใGOSUBใใงใใณใ ใใใใใจใฎใฐใใใซใใใใใ ใใใใใใฏ29ใใใใ ' '--------------------- ' @DISPLAY ' ใคใใฏใใฒใใใใใซใใใใใใใใฎใตใใซใผใใณใฎใใคใใใ ใใ ' ใใใใชใใใใใใฟใใใจใฏใใฃใใใฒใใใใใใใ ใใ ใญใ LOCATE CX,20:PRINT "ใใฏใใใใใใพใใ" '๎ใLOCATEใใฏใใใใใใใใใใฎใใใใฎใซใผใฝใซใฎใใกใใใฆใใใฆใใใใX(ใใ),Y(ใใฆ) ' ใใคใใซใผใฝใซใฏใฟใใชใใใฉCLSใใฏ0,0ใซใชใใPRINTใใฏใใใใใใใใฆใใใใฆใใใ LOCATE 0,0 ' ใธใใใใCXใใฎใใใใใใใงใซใผใฝใซใใกใใใใPRINTใใกใใใใฆใใใ ใ PRINT "ใใ ใใใญใผใงใใใใใใใฉใใใใ" '๎PRINTใฏใ?ใใจใใใใจใใงใใ ใ?"ใใใซใกใฏ"ใ PRINT "X=";X,"Y=";Y ' ใ;ใใ ใจใคใฅใใฆใใใใ,ใใ ใจTABใใใใซใชใใใ ใ ' ใ""ใใงใใใฃใฆใชใใใใฏใธใใใใใคใใใใใใใฎใชใใใใใฒใใใใใใใใ GFILL X,Y,X+32,Y+32,RGB(50,100,255) '๎ใใใฏใใใใใใใใใใใใใ ใใใฒใ ใใใใใฟX,YใใฟใใใใใฟใฎX,Yใจใใฃใใใฆใใใใฆใใใ ' RGBใฏRed(ใใ)ใGreen(ใฟใฉใ)ใBlue(ใใ)ใฎใใใถใใฎใใใใงใใใฎ3ใใใใงใในใฆใฎใใใใฒใใใใใงใใใ RETURN '๎ใใใงใGOSUBใใงใใณใ ใใใใใจใฎใฐใใใซใใฉใใใ ใใกใคใณใซใผใใซใใฉใฃใใใVSYNC 1ใใใใฃใใใใใใ '---------------------------------------- 'A=B+(C*30) ใชใฉใใธใใใใฎใคใใใใใฏใใพใใพใงใใ 'A$="ใใใซใกใฏ" ใ$ใใใใกใใใใใใใคใใ ใธใใใใใใใใพใใ 'B$=A$+"ใใใใใใงใใ ใ" '---------- 'ใใปใใฆใใชใใคใใใฏใใใใใงใใ 'ใใใพใงใใใใงใใใฐใใใฃใใใชใใงใใคใใใใฎใงใใ 'ในใใฉใคใใชใฉใใใใปใใฏใใชใใใใใใงใใใจใฏใใฎใคใฉ 'ใใใใใใฒใใใใชใฉใใใคใใใใใชใใใใใใใใใฐใใใ ใใงใใ 'ใใชใใฉใใใงใใใใพใใพใชใใใใใใใใพใใ 'ใใใใใใฃใฆใฟใพใใใใ ' '-------------------' ใใใใใฎใใใใพใใ 'IF A==1 THEN ' ' B=1 ' A =1ใชใB=1ใใใฃใใใใ ' ELSE ' ELSE ' C=1 ' A!=1ใชใC=1ใใใฃใใใใใ 'ENDIF ' (=ใB=1ใใใฃใใใใใชใใฃใใจใใ) '-------------------' ' '-------------------'IFใฎใชใใซIFใใใใใใพใใ 'IF A==1 THEN ' ' IF B==1 THEN 'A=1ใงใใใซB=1ใฎใจใใฎใฟOK!ใใฒใใใ ' PRINT "OK!" ' ' ENDIF ' 'ENDIF ' '-------------------' ' 'ใใใใ(3ใใ ใใใฐใ)ใใฐใใใใGCLS:CLSใใจใใใชใใจ 'ใณใณใฝใผใซใใใใใใใใใซใฉใใใฒใใใใงใใพใใ 'ใCLS:GCLSใใงใฏ๎งใ