Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (NnamueN, 1 invisible), 1,489 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
animation #273709
06/24/09 02:37
06/24/09 02:37
Joined: Jun 2009
Posts: 148
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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: gamingfan101] #273717
06/24/09 04:54
06/24/09 04:54
Joined: Jul 2008
Posts: 553
Singapore
delinkx Offline
User
delinkx  Offline
User

Joined: Jul 2008
Posts: 553
Singapore
while(1); is wrong.


A7 commercial Team / VC++ 2008 Pro
homepage | twitter | facebook
Re: animation [Re: delinkx] #273736
06/24/09 07:34
06/24/09 07:34
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
Serious User
croman  Offline
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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 Offline
Serious User
croman  Offline
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 Offline
Serious User
croman  Offline
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
G
gamingfan101 Offline OP
Member
gamingfan101  Offline OP
Member
G

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.
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1