Holy cow that looks fantastic
You should consider making a game with all your artwork, after all, it's really difficult to get good art into SmileBASIC, so a game with art like this would quite popular
@Christofer
*cough* *cough* Java is spelled with a capital J
Your code is almost correct, but typing IF BUTTON() AND #A THEN
allows for multiple buttons to be pressed at once, because #A is a bitwise mask for 0b10000 (16) its a trick commonly used in Java to store up to 31 boolean values in a single number
SmileBASIC is a fantastic language, that combines all sorts of programming tricks into a one
Your code is a little strange
do you mean GOTO @LOOP instead of @LOOP? @LOOP is defining a checkpoint in code (a label)
This code looks correct
IF BUTTON() AND #A THEN
BEEP 51
ENDIF
Get rid of 051 and make it 51, in most languages like Java, putting a 0 before the number tells the compiler that that number is in the octal number system, I don't know if that's the case for SmileBASIC though.
Here's what I do:
Declare 2 global variables: FPS, and MS
Find a part of code that gets ran every frame, preferably your main loop.
Place this code:
FPS=(FPS*11+1000/(MILLISEC-MS))/12
MS=MILLISEC
?FPS
You'll notice the *11 and /12 or /(11+1), that will stabilize the number so it moves smoothly, and 11 has been tested as a good smoothness ratio.
That's why the clear command should not exist, it's overpowered
Users shouldn't be able to modify RAM in the first place, or they should and all variables and function pointers should be set to 0
This is a very nice vulnerability for hackers
Wait first tell me what you are trying to do, are you making a multiplayer chat? Or a multiplayer drawing application? Or a multiplayer platformer? A multiplayer firework simulator? Multiplayer pong game? Multiplayer tic tac toe? Chess? Do you have a game you want to add multiplayer to? What's your goal here? ...just wondering :)
BASIC==
Bill's Attempt to Seize Industry Control
Beginners Ascii Standard Instruction Code
Bay Area Shared Information Consortium
British Association of Sport in Colleges
Black Action Strategies and Information Center
Battle Area Surveillance & Integrated Communications
Simple mulyiplayer chat:
(Not tested but I'm 99% sure it works)
ACLS
MPSTART
?"PRESS A TO CHAT"
@LOOP 'make an infinite loop
VSYNC 'make loop run at 60fps
MPRECV TID,MSG$ 'loop for a message
IF TID>=0 THEN ?MPNAME$(TID)+": "+MSG$
IF BUTTON() AND #A THEN
INPUT "TYPE A MESSAGE";MSG$
MPSEND MSG$
ENDIF
GOTO @LOOP
MPNAME$ simply gets the name of whatever device you want
In the SmileBASIC tutorials, these assigned MPLOCAL values are called Terminal IDs
More code examples:
PRINT "Server created by "+MPNAME$(MPHOST)
PRINT "Your name is "+MPNAME$(MPLOCAL)
MPSEND "HI EVERYBODY!"
MPRECV OUT tid,message$
PRINT MPNAME$(tid)+" said "+message$
'which will print out "Squidy said HI EVERYBODY!" to every device
... this is one way to communicate
The other way is using MPSEND
This will send a string to every device connected, it just pushes it onto a queue, then the player uses MPRECV to check whatever's on the queue and get the string
MPSEND and MPRECV are like a mailbox
MPSET does not send any data out, just sets it's own 8 3DS variables
MPGET goes out and looks for someone else's 8 variables
call MPSTART in the very beginning of the game
This will give variable MPLOCAL a number (starting at 0 and counting up, each connected device has a unique number)
This also sets MPHOST
Examples in code:
IF MPLOCAL!=-1 THEN 'if server is open
IF MPLOCAL==MPHOST THEN 'if you are the creator of the server
Now: you use MPGET and MPSET to set a multiplayer value, you can have 8 variables shared ...
There is a hidden cursor (pointer) to the current position in the data, calling RESTORE resets that data cursor back to the beginning
Is this what you were looking for?
Using the DATA command?
RESTORE @MYDATA
FOR I=1 TO 2 'loop twice
VAR A,B,C$
READ A,B,C$ 'read the next 3 values
'if C$ was not a string, it would give an error since the value in the data is a string and C is not
PRINT C$ 'print the string we just read
NEXT
'if we added one more READ A at the end of the loop it would give an error because there is no more data left
END
@MYDATA
DATA 1,2,"HELLO"
DATA 3,4,"WORLD"