Enemy (multi angle running) working scripts

Talk about making games.

Enemy (multi angle running) working scripts

Postby savvy » Thu Mar 31, 2011 7:34 pm

this is an enemy, which runs towards the player (pacblob controlled by moving with mouse) with a 2.5D camera angle, you could use this to make a boxhead type game.
when the enemy gets close, it will also attack.. but this is a demo, so you cant kill it and it cant kill you.
its a simple script, consisting of a change animation for each of the 8 stages.
if(animindex!=aangle) -> aangle is my shortcut for the (angle/360)*8;
{
if(aangle==0)
{
change to rotation 0
}
}
its the same for the attacking, but with an attacking variable.

any questions, post 'em here, if its useful... points would be nice.

(the numbers are my variable testers, they are... useless to you really)
Attachments
screenshot1.png
Enemy rotation tests (now working).zip
GED file
(342.67 KiB) Downloaded 85 times
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Enemy (multi angle running) working scripts

Postby schnellboot » Thu Mar 31, 2011 8:18 pm

this is not exactly the boxhead running type because in boxhead you can only run in 8 directions
you know what I mean? for now it's just the animation but maybe you can upgrade this with direction of running too :)
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Enemy (multi angle running) working scripts

Postby savvy » Fri Apr 01, 2011 8:07 am

this was just the idea of boxhead running, in order to make it exact i need to simply add xvel and yvel values instead of directional_velocity.

OR i just set angles depending on the animindex... eg: 0,45,90...

this is shown in this new update.
Attachments
Enemy rotation tests (now working).zip
(348.44 KiB) Downloaded 78 times
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest