トピック
zag Tall-T

Can I run more than one goto @loop at the same time?

If not ham cab I brake a loop?
2そうだね
未プレイ
返信[1]
親投稿
zag Tall-T
Lol I mean how can I brake a loop?
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そうだね
プレイ済み
返信[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そうだね
プレイ済み
返信[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そうだね
プレイ済み
返信[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そうだね
プレイ済み
返信[6]
親投稿
zag Tall-T
Waw that's awesome. you good at this!
0そうだね
未プレイ
返信[7]
親投稿
zag Tall-T
So how do a break a goto @any_name loop?
0そうだね
未プレイ
返信[8]
親投稿
Ed CPFace
Just GOTO somewhere else.
0そうだね
プレイ済み