1 registered members (AndrewAMD),
1,225
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How can I code a simple player?
[Re: Marc_Gagne]
#232107
10/19/08 15:01
10/19/08 15:01
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
if you dont understand the part of how to move entities then you should go back and learn that and after that you'll know how to create that butterfly movement by yourself. first complete lite-c workshop and after you have completed it and LEARNED it then move on
Ubi bene, ibi Patria.
|
|
|
Re: How can I code a simple player?
[Re: croman]
#232110
10/19/08 15:21
10/19/08 15:21
|
Joined: Apr 2006
Posts: 624 DEEP 13
badapple
User
|
User
Joined: Apr 2006
Posts: 624
DEEP 13
|
#include <acknex.h> #include <default.c>
action buterfly() { var anim_percentage; player = my; while (1) { c_move (my, vector(20 * (key_w - key_s) * time_step, 0 , 0), nullvector, IGNORE_PASSABLE | GLIDE); /////the final 0 in the above c_move instruction is set to 0 for no gravity , if you create it in the air it will stay in the air /////if you want gravity pulling the butterfly down change it to -1 or lower my.pan -= 6 * mouse_force.x * time_step; my.pan +=10 * (key_a - key_d)* time_step; camera.x=my.x-200*cos(my.pan); camera.y=my.y-200*sin(my.pan); camera.z=my.z+100; camera.tilt=-10; camera.pan=my.pan;
ent_animate(my, "fly", anim_percentage, ANM_CYCLE);// the butterfly will animate its fly all the time , use your frame name for fly anim_percentage += 6 * time_step; // "6" controls the animation speed
wait (1); } }
function main() { video_mode = 7; video_screen = 1; sound_vol = 100; level_load("your level here"); wait(4); player=ent_create("butterfly.mdl",vector(0,0,200),buterfly); }
here should be all you need to load a level with your butterfly model and control it with wasd it will always run its fly animating rename fly to your frame name
|
|
|
Re: How can I code a simple player?
[Re: badapple]
#232113
10/19/08 15:29
10/19/08 15:29
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
badapple, this is like you solved him a school test inside of class. he needs to learn it by himself otherwise...
Ubi bene, ibi Patria.
|
|
|
Re: How can I code a simple player?
[Re: badapple]
#232146
10/19/08 18:14
10/19/08 18:14
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
sorry bout that, i didn't mean anything wrong. i just wanted to say that he could learn better if he learns by himself. if he is stuck on something he should go back on the beggining of that lection and read it again. i was thought that it is the best way of learning. you helped him, bravo for you, i have nothing against that, but i just tried on sarcastic way to make a joke - unsuccesfull i wanted him to try to create code for that by himself and if it doesn't work then to ask us for help. isn't that a better way to learn something? try to create it on your own, trust me, you'll learn it better and quicker
Ubi bene, ibi Patria.
|
|
|
Re: How can I code a simple player?
[Re: badapple]
#232164
10/19/08 20:42
10/19/08 20:42
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
hehe, well first of all, it's not my game . i'm a developer in that team. game is in an early fase of development and so the screenshots will not yet be revealed.
Ubi bene, ibi Patria.
|
|
|
|