yo!
i am trying to make it so my game can still play the attack animation. becuase currently i have a spot that says if no keys are pressed the stop the object and have him stand idle. I want it so after you press the spacekey then it plays the attack animation but this is impossible with my other code becuase no buttons are being pressed when the attack animation would be played. heres my code:
basicaly what im asking is, is it possible to give the spacekey immunity to my "if no keys are pressed then go idle" command?
thanks:
Rem Project: Basic_RPG_Test_(soon to be awesome)
Rem Created: 1/30/2006 4:52:32 PM
Rem ***** Main Source File *****
remstart __________________________________________
| |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|<------------Part 1-setting up game------------->|
|||||||||||||||||||||||||||||||||||||||||||||||||||
|_________________________________________________|
remend
`-------------------------------------------------------------------------------------------------------------------
`--------------------------
`Chapter 1-Create world |
`--------------------------
`Setup
set display mode 640,480,16
autocam off
sync on
sync rate 0
set camera view 0,0,640,480
color backdrop rgb(0,0,0)
`----------------------------
`Chapter 2-Load all media |
`----------------------------
rem Activate and distance fogging
fog on
fog distance 3000
fog color RGB(0,0,0)
`Load the world
gosub load_map
`----------->>>load images<<<-------------
`----------------------------------------
rem sync mouse
sync on : hide mouse
make light 1
rem make character
load object "models/character.x",1
scale object 1,350,350,350
`place player near the center of the matrix
position object 1,2623,5,661
`-------------------------------------------------------------------------------------------------------------------
`__________________________________________________
`| |
`|||||||||||||||||||||||||||||||||||||||||||||||||||
`|<--------Part 2-Put all of it together---------->|
`|||||||||||||||||||||||||||||||||||||||||||||||||||
`|_________________________________________________|
`-----------------------
`Chapter 4-Main loop |
`-----------------------
`------------------------------------------
`Main loop
do
set ambient light 10
position light 1,X#,Y#+100,Z#-20
`print "FPS: ",screen fps()
`player movement and turning
if keystate (17)=1 then move object 1, .50 : set object speed 1,2 : loop object 1,1,24
if keystate (31)=1 then move object 1, -.3
if keystate (30)=1 then yrotate object 1, object angle y(1) - .3
if keystate (32)=1 then yrotate object 1, object angle y(1) +.3
if (ScanCode() = 0) then loop object 1,0,0
`Attacking
if spacekey()=1 then play object 1,35,52
`make it so that the character stays above the matrix
x# = object position x(1)
y# = get ground height(1,x#,z#)
z# = object position z(1)
y2# = object position y(1)
`render all of above X# Y# and Z#
position object 1,x#,y#,z#
`place the camera at the players position and face it the same angles it faces
position camera x#, y#, z#
`set camera to object orientation 1
rotate camera object angle x(1), object angle y(1), object angle z(1)
`move camera straight up
xrotate camera 90
move camera -70
`set camera back to players angles and move it behind him
`set camera to object orientation 1
rotate camera object angle x(1), object angle y(1), object angle z(1)
move camera -200
`draw changes
sync
`end loop
loop
load_map:
M=2
if matrix exist(1) then delete matrix 1
load bitmap "LVLHM3.bmp",1
set current bitmap 1
bw=bitmap width(1)-1
bh=bitmap height(1)-1
masix=(bw*100)*M
masiz=(bh*100)*M
make matrix 1,masix,masiz,bw,bh
smx#=((bw*-500)*m)/2
smz#=((bh*-500)*m)/2
if image exist(1) then delete image 1
load image "LVLHM3.bmp",1
prepare matrix texture 1,1,bw,bh
in=0
`bw-1
for x=bh to 1 step -1
for z=1 to bw
in=in+1
set matrix tile 1,z-1,x-1,in
next z
next x
for x=0 to bw
iz=bh+1
for z=0 to bh
iz=iz-1
h=point(x,iz)
h=(rgbr(h)+rgbg(h)+rgbb(h))/3
set matrix height 1,x,z,h*(m+1)
next z
next x
update matrix 1
delete bitmap 1
return
~snow