The first question is, if i was making a character attack an enemy, would i need up the top a code like :
rem character/emeney attacks
gosub character_emeny_attack
Put that code in the bit of the program where the attack happens - if it was at the top then the char would attack once when it's first run and nowhere else. Usually it would go where marked here:
if [pressing attack key]
`<--------- code to attack goes here --------->
endif
Quote: "Second question is, i have the basic idea on how to take down a character/ememy health down, but how to actually attack.
Like i have a ninja, (in the DarkMATTER) and i want to make sure that when you hit a button like "a" it will attack.
What sort of code would be best? do i need to collide? cant i just have a code that does something like:
attack=0
If keystate(32)=1 then attack=1
Then somewhere in the code have something to do with.
If attack=1 then.......
Or do i have to collide?"
Looks fine here - the collision bit would go in the "If attack=1 then......." bit. After checking if we're attacking then you check iuf the sword is colliding with the enemy, and if so then deduct health.
Quote: "Alsocould i possible ask this question, in my game i will have a big area, when you do a certain thing i want to make a cut scene, and then taking to another level, what sort of code would i need, this does sound hard?
What i mean is, if you are controlling a character, right, now say you walk into a house and beat a certain monster, how would you make a cut scene after it, and then a level complete and then a level 2?"
Yes - in the main loop check if you have defeated the monster. When you do then call sub subroutine which will put the camera somewhere, move around some models and then go back to the main loop, with the char in a different position.
c:/dos
c:/dos run
run dos run