Arrays work like this for any one wondering:
an array is just a variable with multiple values, DIM ArrayName[10] has 10 values in it, to pull out a value put ArrayName[5] (or any number within the number you put at the DIM command), but the DIM command must specified first before pulling out a value from they array. DIM declares the Array. The brackets in the DIM command tell you how many
Make a quick mock-up design of your framework for your game or project, then see what is wrong with it. Next, start over completely and make a second version incorporating what you wanted in the first version, then you can start working on graphics and game ideas fulltime.
In my experience, this actually works if you stick to it, compared to just the freestyle mess that usually happens when you
(posted by PChicken)^
I don't recommend use : as new line because the code became hard to read.
Try to organize your code in a way that is easy to read. Some tips:
- Use commentaries to separate parts of your code.
- Try to write what your code do on process that are complex.
- Avoid programming in one line. Try to keep the length of each line less than 40 char to have a clear view of whats
going on.
Don't use goto or gosub. Use DEF instead of gosub.
- Don't repeat yourself. Try to create functions (Using DEF) instead of copy paste. That way, you have to do less changes in the future.
Finally, I recommend search in google "game programming patterns". I know this is not a OOP language but there are useful information to make things with less code, easier to understand and faster.
(by raimondz^)
title screens.
for some this means nothing and are like "eh.. put the name.." BUT for some this means war!
-so ideas on how to make good ones-
1st off it MUST have to do with your game, so if you have created strites (or not) put something cool from in your game, the best looking sprites guys!
2nd is putting bg screens, you can put a bg screen behind everything to make it look awesome! 4 different layers too!
-use bg screens to thier fullest-
3rd is the name (title) of your game.
DO NOT (unless it fits your game) JUST PUT IT IN TEXT! like:
"(not) COOL RPG GAME"
make sprites for it! its not that hard and is way worth it.
4th is maybe adding graphics like a box outside/insd the title.
Functions are a bit of code that you can use again and again, just by using its name like any other command.
In SmileBASIC, functions come in 3 forms:
*No values returned (no parenthesis)
DEF HI
?"Hi!"
END
*1 value returned (yes parenthesis, must include RETURN [value] somewhere)
DEF E()
RETURN 2.7182818
END
*2 or more values returned (no parenthesis but with an OUT, no RETURN)
no space 4 this
1.- When you're writting, you will notice a list of commands on the touch screen. Touch the command you want to write and will autofill.
2.- Locate the cursor over a command and tap the "?" on the touch screen to see the explanation of the command. This is way more useful than consulting the Manual Reference if you want to clear doubts quickly.
Calling the function. If you have custom bg tiles load those first.
You are still in charge of game physics. You decide if sprites can move places and how they move. It isn't much more than a background image.
I think you want to press a button and go to a loop, right?
Use IF BUTTON(2) AND #A THEN GOTO @LOOP. I don't see why you saving whatever text the player puts in INPUT into YES$, I think your trying to have the player input "Yes" to have the game started, to that you'll have to use INPUT "Play" ; VARIABLE$
IF VARIABLE$=="Yes" THEN GOTO @LOOP