プレイ日記
Ricardo Caffeine305
Any hints? I'm trying to do a simple on/off switch but no working. Logic goes like this: Screen untouched (TM<0) and flag False, then set flag to True. either, set False.
4そうだね
プレイ済み
返信[1]
親投稿
C. Norris 06495a
Use '&&' instead of 'and'. Use and if you are doing something with buttons: if button(2) and #up
0そうだね
プレイ済み
返信[2]
親投稿
Hanzo rzsense
Do you try to make toggle switch? If so, refer to the following code. @SWITCHFLAG IF TM==1 THEN FLAG=(!FLAG) RETURN
2そうだね
未プレイ
返信[3]
親投稿
Ricardo Caffeine305
Thanks Norris, Hanzo! @Hanzo: Think I've seen something like that on Stackoverflow.com or somewhere around the net. Though it wouldn't work in here SmileBASIC. Wrong part is I never tried it!!
0そうだね
プレイ済み
返信[4]
親投稿
Ricardo Caffeine305
Think I get it now! since TM is a counter that adds as long as the touchscreen is touched, the condition TM > 0 will be true each and every time TM goes +1, that's why I had this cintillatin, always changing 0/1 flag value. On the other hand TM == 1 occurs once and exactly only once each time the touchscreen is pressed.
1そうだね
プレイ済み
返信[5]
親投稿
Ricardo Caffeine305
made a little gizmo with your hints: a chest that opens an closes when touched Public Key is P3KNQ5NKS Not very interesting but I plan to use this on a game I'm struggling to write.
0そうだね
プレイ済み