Well, I dont think many people will do this, because it sounds like you dont really care if you learn to program or not. You should read the tutorials, believe me they will help. How long have you been using DB anyways?
About your questions with the positions. The "code" you gave means ABSOLUTLY NOTHING. This is what you mean, probably.
Object Position Y(x)
Object Position X(x)
For the x's in the parenthesis, that is what the object number is. Full code would look like...
Load object "myobject.x",1
do
if upkey()=1 then move object 1,10
if downkey()=1 then move object 1,-10
xpos#= Object Position X(1)
ypos#= Object Position Y(1)
set cursor 0,0
Print "The Objects X position is ";xpos#
Print "The Objects Y Position is ";ypos#
loop
Now I will explain that.....
Line 1) This line simply loads the model, and assigns it the variable of 1. When telling the model what to do, you must always use its assigned variable. Models need to be in the same folder as your projects code.
Line 3) This line starts the main loop of the program. This keeps the program running. If the DO is not there, then the program will not run, instead, it will come up with a screen showing your object and saying that it has completed running the code with the prompt "Press F12 To return to the Editor"
Lines 4 & 5) These lines are telling the object IF a key is pressed THEN do the corresponding commands. This is called an IF THEN statement. So, IF the UPKEY is pressed THEN MOVE the OBJECT [1] a positive 10. As you can see here, the object is called by the 1 that we assigned to it earlier. The same commands go for the 5th line of code.
Lines 7 & 8) In these lines, we assign words to commands. This will simply keep our code shorter. Here I used xpos# and ypos#. The pound signs (#) are there to show this is a number value, and will be used later in the code. This is telling the system that when xpos# is mentioned, it is referring to the OBJECTS X POSITION. That is what the line of code means. It is literally saying... xpos# means the position of object 1 on the X axis. The same goes for the ypos# line. It translates the same way, just replacing X with Y.
Lines 10-12) Line 10 SETS THE CURSOR at 0,0. Since we are in a LOOP, the cursor needs to be set at one position, or else the words will go way down the screen over and over again. Lines 11 and 12 use our variables that we set earlier. The PRINT command tells the computer to PRINT the following words. Words are represented in "Quotes". Line 11 tells the computer to print, at 0,0, "The Objects X Position is ". This is then followed by a semi-colon (
which tells the computer to print the following information on the same line. the following information is the variable that we just set, xpos#. Going back earlier, this is telling the computer to print the object 1's x position. The same information goes for the 12th line, just with Y instead of X.
Line 13) This line is the LOOP statement. This concludes a DO LOOP statement. It closes the main loop. For every DO there must be a corresponding loop somewhere else in the code. There are always the same amount of Do's and Loop's.
Well, that pretty much sums up the OBJECT POSITION command. Now try and tell me that THAT tutorial wasnt useful. I wrote it for a complete noob, so it should be VERY easy to understand.
If you need anymore help, contact me on the instant messengers below. My MSN is TheBedroomProgrammer@hotmail.com, my sign in name is RPGamer.
Regards,
RPGamer
Current - RPG: Eternal Destiny : Help Wanted!
Upcoming- MMOFPS- Paintball Game: HELP WANTED!
Http://halbrosproductions.netfirms.com