Archiverse Internet Archive
投稿のみ 投稿と返信
前のページ(最近)
1 2 3
次のページ(過去)
返信[6]
親投稿
Nicole moesaku
That said, there's some stuff that can be improved upon: You don't have to manually put in the numbers for different buttons, there's constants like #A, #B, #LEFT, #UP, and so on. Also, something like BUTTON()==#A will be true every frame that A is held down, not just the first frame it's been pressed. You can write BUTTON(2)==#A instead of BUTTON()==#A to specifically look for presses.
1そうだね
未プレイ
返信[4]
親投稿
Nicole moesaku
These are the simplest changes needed to make it work: ACLS TIME=60 SCORE=0 @MAIN IF BUTTON()==32 THEN SCORE=SCORE+1 ENDIF TIME=TIME-1 CLS PRINT SCORE WAIT 1 GOTO @MAIN
2そうだね
未プレイ
返信[1]
親投稿
Nicole moesaku
The command NEW will clear all program slots! NEW 0 through NEW 3 will clear a specific slot.
1そうだね
未プレイ
返信[23]
親投稿
Nicole moesaku
The Japanese community is called "Petit computer 3 Community", since this goes by a different name there.
1そうだね
未プレイ
返信[2]
親投稿
Nicole moesaku
That public key is old and doesn't work anymore. The current public key for Cyburst is RRWECV3V.
1そうだね
未プレイ
返信[5]
親投稿
Nicole moesaku
@Aaron It is a programming game, but people have programmed drawing programs in it.
2そうだね
未プレイ
返信[13]
親投稿
Nicole moesaku
That is a good point about VSYNC. At the moment, it looks like you have VSYNC 5 to limit the speed of the player. That's fine, but it limits your whole game to 12 frames per second, since 60 divided by 5 is 12. For a simple game this is probably okay, but if you want to limit this to just the player, you could use a variable that counts down each frame before it allows the player to move.
0そうだね
未プレイ
返信[12]
親投稿
Nicole moesaku
Yes, ENDIF isn't needed with your code. It's only needed if you have code like this: Line 1> IF B==#RIGHT THEN Line 2> PX=PX+1 Line 3> LOCATE PX-1,PY Line 4> PRINT " " Line 5> ENDIF because otherwise it wouldn't know where the IF ends. Your code is like: Line 1> IF B==#RIGHT THEN PX=PX+1:LOCATE PX-1,PY:PRINT " " so it doesn't need ENDIF because that form of IF ends at the end of the line.
0そうだね
未プレイ
返信[4]
親投稿
Nicole moesaku
@sruly You don't need Wi-Fi to write your own programs and games, but you'll need it to download others' projects or upload your own.
1そうだね
未プレイ
返信[8]
親投稿
Nicole moesaku
It's because you've moved some stuff out of your loop. The line where you update B and the line where you print the player should be inside your loop, like in your first screenshot, or else they'll only be run once. Also, note that ENDIF is only necessary if you split your IF into separate lines. This doesn't need ENDIF: IF condition THEN code This does: IF condition THEN code ENDIF
0そうだね
未プレイ
返信[5]
親投稿
Nicole moesaku
This can be used for more complex button checks, too! For instance, B AND (#LEFT OR #RIGHT) is true when either Left or Right are pressed.
0そうだね
未プレイ
返信[4]
親投稿
Nicole moesaku
So, when Right isn't pressed, B AND #RIGHT equals 0, because #RIGHT isn't set in B, but is set in #RIGHT. When Right is pressed, B AND #RIGHT equals #RIGHT, because #RIGHT is set on both sides. In other words, it'll be either 0 or #RIGHT. Any number that isn't 0 is considered true, so these come out as false or true.
0そうだね
未プレイ
返信[3]
親投稿
Nicole moesaku
The other issue is a bit more complex. Basically: B==#RIGHT is true when Right is the *only* button being pressed. B AND #RIGHT is true when Right is pressed, regardless of other buttons. It's hard to explain without getting into binary, but basically each button is a bit. AND matches the bits on one side with the bits on the other side, and creates a number with only the bits set on both.
0そうだね
未プレイ
返信[2]
親投稿
Nicole moesaku
As for checking buttons, there are some things that can be improved. First, note that there are built-in constants for the buttons like #UP, #DOWN, #A, #B, #L, and so on. So, rather than B==8, you can write B==#RIGHT, which is a lot easier to understand.
0そうだね
未プレイ
返信[1]
親投稿
Nicole moesaku
I'm not sure if you're coming from Petit Computer, which limited IF statements to one line, but in SmileBASIC, you can have multiple lines in an IF, like so: IF B==8 THEN X=X+1 LOCATE X-1,Y PRINT " " ENDIF Also, rather than @LABEL ... GOTO @LABEL, I personally find it cleaner to use WHILE or REPEAT instead.
0そうだね
未プレイ
返信[2]
親投稿
Nicole moesaku
(Google Translate) Básicamente, "Petit Computer" es la versión 2 y "SmileBASIC" es la versión 3. (La versión 1 era sólo de Japón). Esta nueva versión es muy diferente, pero es mucho más rápida y mucho más potente que Petit Computer. Si te gustó Petit Computer, te recomiendo esto.
1そうだね
未プレイ
返信[1]
親投稿
Nicole moesaku
Basically, "Petit Computer" is version 2 and "SmileBASIC" is version 3. (Version 1 was Japan-only.) This new version is very different, but it is much faster and much more powerful than Petit Computer. If you liked Petit Computer, I recommend this.
1そうだね
未プレイ
返信[7]
親投稿
Nicole moesaku
A shorter way than using RESTORE and looping is to do this: DIM MYARRAY[4] COPY MYARRAY,@MYDATA @MYDATA DATA 5,362,556,1
1そうだね
プレイ済み
返信[3]
親投稿
Nicole moesaku
- It can be tedious to type PRINT over and over, but there's a faster way. ? is short for PRINT. Also, closing quotes are optional at the end of a line. So, these are the same: PRINT "Hello!" ?"Hello! - Any command of the form NAME ... OUT A, where only one value is output, can also be used as NAME(...), and vice versa.
4そうだね
未プレイ
返信[3]
親投稿
Nicole moesaku
This program starts with BGMSTOP and CLS to stop the music and clear the screen, but there's a more thorough way to do this that might be helpful. SNDSTOP stops all currently playing sounds, whereas BGMSTOP only stops music. ACLS resets the whole screen, whereas CLS only clears text, not graphics.
1そうだね
未プレイ