ya well i want my player object (1) to be in the center along with object 2...how can i do this? heres my game
```````````````````````````````````````
`I like to call this breathing room `
`It makes my program feel less cramped`
```````````````````````````````````````
`````````````````````````````
`MATRIX/BACKDROP/WORLD SETUP`
`````````````````````````````
rem make matrix
make matrix 1,1000,1000,10,10
rem backdrop
load image "grass1.bmp",1
prepare matrix texture 1,1,1,1
rem make sky box
`First we must load our outside media.
load image "moonlit/moonlit.bmp",2
`Next, we'll make our skybox.
`We have 2 options, a cube or Sphere.
`You really won't know which looks better, until you try them each out.
make object sphere 3,-5000
`Notice how we make the size negitive, this makes it so the texture will appear on the inside.
`Now we simply texture the skybox.
texture object 3,2
`make texture on top
zrotate object 3,180
fix object pivot 3
````````````````````````````````````````````````````````````````````````````````````````
` PLAYER SETUP `
````````````````````````````````````````````````````````````````````````````````````````
rem Load 3D object and append walking data to it
LOAD OBJECT "Ninja/H-Ninja-Idle.x",1
append object "Ninja/H-Ninja-Move.x",1,26
append object "Ninja/H-Ninja-Attack1.x",1,51
append object "Ninja/H-Ninja-Impact.x",1,76
`append object "Ninja/H-Ninja-Die",1,87
YROTATE OBJECT 1,180 : FIX OBJECT PIVOT 1
rem scale the ninja guy
scale object 1,300,300,300
rem Loop 3D object animation from 1 to 25 (idle)
LOOP OBJECT 1,1,25 : SET OBJECT SPEED 1,30
``````````````````
`HEALTH BAR SETUP`
``````````````````
set text size 24
ink rgb(255,0,0),1
`This is your variable that you'll use for your health box
H=100
``````````````
`KI BAR SETUP`
``````````````
set text size 24
ink rgb(255,0,0),1
`This is your variable that you'll use for your ki box
k=100
```````````````````````````````````````````````````````````````````````````````````````
` ENEMY SETUP `
```````````````````````````````````````````````````````````````````````````````````````
make object sphere 2,7
`````````````````````````````````
`END SETUP PREPARE FOR MAIN LOOP`
`````````````````````````````````
rem Activate manual syncronization
SYNC ON : sync rate 60
rem Begin loop
DO
````````````
`HEALTH BAR`
````````````
`This is the health box used to increase/decrease
`H is your variable. Basically, when you add to H, the box grows and when you subtract, it decreases.
box 10,20,H,30
rem This makes max health 100
If H >100
H=H-0.01
endif
rem this limits the minimum health to 0
If H<0
H=H+0.01
endif
rem (Press 1 to add health)
If keystate(2)=1
rem This makes H equal H+1
H=H+1
endif
rem (Press 2 to decrease health)
If keystate(3)=1
H=H-1
endif
rem This line is used to round your health to the nearest 1's place.
set cursor 5,30
print "Health "
`````````
`KI BAR`
`````````
`This is the ki box used to increase/decrease
`ki is your variable. Basically, when you add to ki, the box grows and when you subtract, it decreases.
box 10,50,k,60
rem This makes max ki 100
If k >100
k=k-0.01
endif
rem this limits the minimum ki to 0
If k<0
k=k+0.01
endif
rem (Press 3 to add ki)
If keystate(4)=1
rem This makes Ki equal ki+1
k=k+1
endif
rem (Press 4 to decrease ki)
If keystate(5)=1
k=k-1
endif
rem This line is used to round your ki to the nearest 1's place.
set cursor 5,70
print "Ki "
```````````````````````````
`PLAYER CONTROLS/PLACEMENT`
```````````````````````````
rem position object and make angle
x1#=object position x(1)
y1#=object position y(1)
z1#=object position z(1)
ay1#=object angle y(1)
set camera to follow x1#,y1#,z1#,ay1#,15,5,1,1
rem Update character position and angle
POSITION OBJECT 1,x#,0.0,z#
YROTATE OBJECT 1,a#
rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-4.0
IF RIGHTKEY()=1 THEN a#=a#+4.0
a#=wrapvalue(a#)
rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,.9) : z#=NEWZVALUE(z#,a#,.9) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-.9) : z#=NEWZVALUE(z#,a#,-.9) : stage=1
rem Attack if spacebar is pressed
IF SPACEKEY()=1 then stage=2
rem if he gets hit
if object hit(1,2)=1 then stage=3
if object hit(1,2)=1 and H=0 then stage=4
`````````````````
`STAGES/TURNOUTS`
`````````````````
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,1,25
SET OBJECT SPEED 1,30
ENDIF
IF stage=1
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,31,50
SET OBJECT SPEED 1,70
ENDIF
IF stage=2
LOOP OBJECT 1,51,75
SET OBJECT SPEED 1,100
ENDIF
IF stage=3
H=H-10
PLAY OBJECT 1,76,100
SET OBJECT SPEED 1,50
ENDIF
IF stage=4
PLAY OBJECT 1,76,100
set object speed 1,50
ENDIF
oldstage=stage
ENDIF
sync : loop
please help