プレイ日記
SomeThing… DJZouk2017
How do I make a chunk of code continuously run whilst another chunk runs? For example, code which causes the background's color to randomly change and code that continuously moves a sprite to random places on the screen, both running simultaneously.
2そうだね
プレイ済み
返信[1]
親投稿
*J.P.* DEV NEWPICY3
um just put both the code in the loop. a normal game starting loop for me starts with: ACLS XSCREEN 2 X=0:Y=0 WHILE 1 VSYNC WEND I made a function to put all that automatically with the press of one button, and it was very small and easy to write (I think 4 or 5 lines of code)
0そうだね
プレイ済み
返信[2]
親投稿
Levi LeviJS
put the chunks of code into separate defs and call them in a while loop. WHILE 1 userDefinedFunction1 userDefinedFunction2 VSYNC WEND
0そうだね
プレイ済み
返信[3]
親投稿
Autz sonic-HD8765
You can't execute two things simultaneously on SmileBASIC, the only thing you could do is to execute both chuncks as fast as you can. Which means you have to re-think your algoritm.
0そうだね
プレイ済み
返信[4]
親投稿
Quote QuoteGamer
@LOOP (stuffs you want to do) GOSUB @ACT2 GOTO @LOOP @ACT2 (other stuffs) RETURN This can only do so much*
0そうだね
プレイ済み