Hi there, i have a code setup, could you tell me if the code i am writing is correct so far.
Rem Andrew's Very First Game
Rem Thanks to all of those that helped me at the website.
sync on : sync rate 60 : hide mouse : backdrop off
Rem loading scene
load bitmap "gametstart/backdrop",1
sync : delete bitmap 1
Rem create character for game
gosub _create_character
Rem load models for enemies
gosub _create_enemies
Rem create world and sky
gosub _create_world
Rem start game
gosub _start_game
Rem main loop
do
Rem Control Character
gosub _control_character
Rem control enemies
gosub _control_enemies
Rem Update screen
sync
Rem end the loop
loop
end
_control_character
Rem start of actions for character
Walk=0
Run=0
attack1=0
attack2=0
health=200
gameover=0
If upkey()=1 then move object 2,6 : run=2
If downkey()=1 then move object 1,4 : walk 1
if leftkey()=1 then yrotate object 1,wrapvalue (object angle y(1)-4) : walk 1
If rightkey()=1 then yrotate object 1,wrapvalue (object angle y(1)+4) : walk 1
If shiftkey()=1 then attack1=1
If keystate(30)=1 then attack2=1
end if
rem track the hero with the camera
Rem Animation for Character
If walk=0 then loop object 1,0
If walk=1 then loop object 1,60
Rem character attacks enemy
if attack1=1
Also i am i little stuck on the Rem character attacks enemy.
I dont know what i am supposed to be putting here, like the collision, can you help?
I think that code is wrong in someway, i think it's the code saying.
If statekey(30)=1 then attack
Or does it seem to be ok?
I though instead of having that part of the code, i thought you might place it under the attack controls like:
Rem character attacks
If statekey(30)=1 then collide objects
??
Thanks -
Andrew