Archiverse Internet Archive
投稿のみ 投稿と返信
前のページ(最近)
1 2 3 4 5 6 7 8 9 10 11 12 13 14
次のページ(過去)
返信[1]
親投稿
Ed CPFace
SmileBASIC doesn't mind! Labels defined within a function are considered local to that function, and do not count as duplicates if the same label is used elsewhere.
2そうだね
プレイ済み
プレイ日記
Ed CPFace
Tip of the day! Label scope. The more structured your program is, the less need you'll have for labels. But what happens if you need a label in a function and you accidentally reuse a label from your main program?
8そうだね
プレイ済み
返信[5]
親投稿
Ed CPFace
Here's a conversation where I got help on the subject. https://miiverse.nintendo.net/posts/AYMHAAACAAADVHkmXGmS3w And if you haven't already, you can look at my library for an example of how it works. Public key [Q3KKVPDM]
2そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
As for your B array, I'm guessing it was defined in the program file that's using this library. Unfortunately, your library can't "see" any variables that were defined outside of it. Either you must pass B into INIT as an argument and work with it there, or you must define B in your library and set up COMMON functions that allow other files to access it.
1そうだね
プレイ済み
返信[3]
親投稿
Ed CPFace
I was having this exact problem. This is a screenshot of the library, yes? So you're including it from some other program file? I found that I had to use EXEC "PRG1:LIB" instead of USE "PRG1:LIB". This allows the library to define its local variables. They remain in memory, but they can only be accessed by the library's functions. That should solve your A array.
2そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
Tee hee. Charmanderp.
1そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
You have to enter those lines in EDIT mode. Tap the big EDIT button, put the lines in, then go back to DIRECT mode to run it.
0そうだね
プレイ済み
返信[9]
親投稿
Ed CPFace
Change 107 to FOR I=0 to REC and 110 to VSYNC 1
2そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
I got so much out of the original Petit Computer, and this one is even better. If you keep at it, I think you'll have a good time.
2そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
What a nightmare it was, trying to optimize your save data into 256 bytes. Yeah, I managed it, but it's so much nicer to have that freedom.
2そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
Did you want to do keyboard entry that won't put messy text on the upper screen? Try looking at the 5th page of help for the DIALOG command. It's limited keyboard entry that doesn't mess up either screen, good for simple things like name or number entry. If you're trying to do anything like INKEY$, well... I don't know how to help there. Might have to make your own keyboard.
1そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
It's probably best to just pick one screen mode and stick with it. I'm guessing that you want to use INPUT? An INPUT command will automatically replace the lower screen with a keyboard and then return it to normal when it's done.
1そうだね
プレイ済み
返信[1]
親投稿
Ed CPFace
Your second loop is blinking because you're clearing and rewriting it every 1/12 of a second. Try it like this. Put your text outside of your loops and use vsync for timing instead of WAIT.
0そうだね
プレイ済み
返信[8]
親投稿
Ed CPFace
Just GOTO somewhere else.
0そうだね
プレイ済み
返信[6]
親投稿
Ed CPFace
Here's an example.
0そうだね
プレイ済み
返信[5]
親投稿
Ed CPFace
If it's: @LOOP GOTO @LOOP breaking out is as simple as GOTO @SOMEWHERE. But if you're using a looping command (WHILE, REPEAT, FOR) you should use the BREAK command to end your loop and free up the memory that the system uses while running those kinds of loops.
0そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
You also have to check for special events that change the state of your program - if the player goes through a door or finishes a stage or is defeated by an enemy, etc. and move to different loops throughout your program accordingly. As far as breaking out of a loop, yes, you can do it if you need to, but how you do it depends on the kind of loop you've got.
0そうだね
プレイ済み
返信[3]
親投稿
Ed CPFace
Here's an example of how I structure my programs: Set initial conditions -- draw the screen, set variables, etc. Do this forever: Check inputs -- buttons, touchscreen, whatever I'm using Change data based on inputs Calculate new positions for onscreen objects based on data -- how far does everything move in 1/60th of a second? Move onscreen objects to their new positions Repeat.
0そうだね
プレイ済み
返信[2]
親投稿
Ed CPFace
In this language, the CPU will only ever run one command at a time, going down the line in the order you wrote them. If it seems like the system is doing several things at once, it's because the program was organized so that it would do a little bit of everything for every frame of animation.
0そうだね
プレイ済み
返信[4]
親投稿
Ed CPFace
BGOFS, SPOFS, and LOCATE change the screen positions for background, sprites, and printed text, respectively. If you check the help screen for these commands, you'll see that there's an option to position these things along a Z axis. A negative Z value makes things pop out of the screen, and a positive value pushes them into the screen.
1そうだね
プレイ済み