2 registered members (NnamueN, 1 invisible),
1,489
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
animation
#273709
06/24/09 02:37
06/24/09 02:37
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
hi, im trying to get my character to move right when i press the D button, and left when i press the A . Here is my code, can anyone tell me where to go from here?
/////////////////////////////// #include <acknex.h> #include <default.c>
///////////////////////////////
PANEL* boxie = { bmap = "boxie.bmp"; pos_x = 300; pos_y = 300; layer = 1; flags = OVERLAY | SHOW; }
PANEL* walk = { bmap = "boxiewalk.bmp"; pos_x = 300; pos_y = 300; layer = 1; flags = OVERLAY; }
PANEL* dead = { bmap = "boxiedead.bmp"; pos_x = 300; pos_y = 300; layer = 1; flags = OVERLAY; }
function animateboxie() { while(!key_d) wait(1); while(1); { if(key_d){boxie.pos_x -=24*time_step} } }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: animation
[Re: delinkx]
#273736
06/24/09 07:34
06/24/09 07:34
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
while(1) { if(key_d){boxie.pos_x -=24*time_step} wait(1); }
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: animation
[Re: EvilSOB]
#273881
06/24/09 20:12
06/24/09 20:12
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok, here the animation part of the code, but it says that while(1) is wrong, I've tried deleting it, but then it says the next line is wrong.
function animateboxie() while(1) { if(key_d){boxie.pos_x -=24*time_step} wait(1); }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: animation
[Re: gamingfan101]
#273882
06/24/09 20:13
06/24/09 20:13
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
and also, how would i code it to alternate between two picttures (boxie.bmp, and boxie.walk)
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: animation
[Re: gamingfan101]
#273885
06/24/09 20:28
06/24/09 20:28
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
you're missing a semicolon ";"
Ubi bene, ibi Patria.
|
|
|
Re: animation
[Re: croman]
#273891
06/24/09 20:41
06/24/09 20:41
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
i tried putting it there, it still didnt work.
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
Re: animation
[Re: gamingfan101]
#273894
06/24/09 20:57
06/24/09 20:57
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
what is the exact error message you get?
Ubi bene, ibi Patria.
|
|
|
Re: animation
[Re: croman]
#273896
06/24/09 20:58
06/24/09 20:58
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
oh stupid me you're missing the whole function braces "{" and "}"
Ubi bene, ibi Patria.
|
|
|
Re: animation
[Re: croman]
#273900
06/24/09 21:02
06/24/09 21:02
|
Joined: Jun 2009
Posts: 148
gamingfan101
OP
Member
|
OP
Member
Joined: Jun 2009
Posts: 148
|
ok here the code now, and the error message still comes up saying "error in MAIN line 37, 'if(key_d){boxie.pos_x -=24*time_step}' "
function animateboxie() { while(1); if(key_d){boxie.pos_x -=24*time_step} wait(1); }
Sorry, im new. I have a tendency to ask really simple questions, so please be patient.
|
|
|
|