Gamestudio Links
Zorro Links
Newest Posts
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
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 1,100 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Change a pannel to VISIBLE by press a key: Help me please #242595
12/24/08 14:04
12/24/08 14:04
Joined: Dec 2008
Posts: 16
Kokirikind Offline OP
Newbie
Kokirikind  Offline OP
Newbie

Joined: Dec 2008
Posts: 16
Hi @ all
i've got a problem with my code, i try to make a little Game, I made a Ground Pannel and 12 Pannels of the moving of the Player, i also made the code to put all together and to move the Player, but the problem is, if i walk right there should be the pannels for walking right too...
the Code:


#include <acknex.h>
#include <default.c>

BMAP* Background_Grass_tga = "Background_Grass.tga";
BMAP* Player_up1_tga = "Player_up1.tga";
BMAP* Player_up2_tga = "Player_up2.tga";
BMAP* Player_up3_tga = "Player_up3.tga";
BMAP* Player_down1_tga = "Player_down1.tga";
BMAP* Player_down2_tga = "Player_down2.tga";
BMAP* Player_down3_tga = "Player_down3.tga";
BMAP* Player_left1_tga = "Player_left1.tga";
BMAP* Player_left2_tga = "Player_left2.tga";
BMAP* Player_left3_tga = "Player_left3.tga";
BMAP* Player_right1_tga = "Player_right1.tga";
BMAP* Player_right2_tga = "Player_right2.tga";
BMAP* Player_right3_tga = "Player_right3.tga";



/////////////////////////////////////////////////////////////////

PANEL* Player_up1_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_up1_tga;
flags = OVERLAY ;
}

PANEL* Player_up2_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_up2_tga;
flags = OVERLAY ;
}

PANEL* Player_up3_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_up3_tga;
flags = OVERLAY ;
}

PANEL* Player_down1_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_down1_tga;
flags = OVERLAY | VISIBLE ;
}

PANEL* Player_down2_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_down2_tga;
flags = OVERLAY ;
}

PANEL* Player_down3_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_down3_tga;
flags = OVERLAY ;
}

PANEL* Player_left1_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_left1_tga;
flags = OVERLAY ;
}

PANEL* Player_left2_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_left2_tga;
flags = OVERLAY ;
}

PANEL* Player_left3_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_left3_tga;
flags = OVERLAY ;
}

PANEL* Player_right1_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_right1_tga;
flags = OVERLAY ;
}

PANEL* Player_right2_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_right2_tga;
flags = OVERLAY ;
}

PANEL* Player_right3_pan =
{
pos_x = 30;
pos_y = 30;
layer = 2;
bmap = Player_right3_tga;
flags = OVERLAY ;
}
///////////////////////////////////////////////////////////////

PANEL* Background_Grass_pan =
{
pos_x = 0;
pos_y = 0;
layer = 1;
bmap = Background_Grass_tga;
flags = VISIBLE;
}

///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////

function move()
{
while(1)
{
if(key_cud)
{
Player_up1_pan.pos_y +=0.2 ;
Player_up2_pan.pos_y +=0.2 ;
Player_up3_pan.pos_y +=0.2 ;
Player_down1_pan.pos_y +=0.2 ;
Player_down2_pan.pos_y +=0.2 ;
Player_down3_pan.pos_y +=0.2 ;
Player_left1_pan.pos_y +=0.2 ;
Player_left2_pan.pos_y +=0.2 ;
Player_left3_pan.pos_y +=0.2 ;
Player_right1_pan.pos_y +=0.2 ;
Player_right2_pan.pos_y +=0.2 ;
Player_right3_pan.pos_y +=0.2 ;


}

if(key_cuu)
{
Player_up1_pan.pos_y -=0.2 ;
Player_up2_pan.pos_y -=0.2 ;
Player_up3_pan.pos_y -=0.2 ;
Player_down1_pan.pos_y -=0.2 ;
Player_down2_pan.pos_y -=0.2 ;
Player_down3_pan.pos_y -=0.2 ;
Player_left1_pan.pos_y -=0.2 ;
Player_left2_pan.pos_y -=0.2 ;
Player_left3_pan.pos_y -=0.2 ;
Player_right1_pan.pos_y -=0.2 ;
Player_right2_pan.pos_y -=0.2 ;
Player_right3_pan.pos_y -=0.2 ;

}

if(key_cul)
{
Player_up1_pan.pos_x -=0.2 ;
Player_up2_pan.pos_x -=0.2 ;
Player_up3_pan.pos_x -=0.2 ;
Player_down1_pan.pos_x -=0.2 ;
Player_down2_pan.pos_x -=0.2 ;
Player_down3_pan.pos_x -=0.2 ;
Player_left1_pan.pos_x -=0.2 ;
Player_left2_pan.pos_x -=0.2 ;
Player_left3_pan.pos_x -=0.2 ;
Player_right1_pan.pos_x -=0.2 ;
Player_right2_pan.pos_x -=0.2 ;
Player_right3_pan.pos_x -=0.2 ;

}

if(key_cur)
{
Player_up1_pan.pos_x +=0.2 ;
Player_up2_pan.pos_x +=0.2 ;
Player_up3_pan.pos_x +=0.2 ;
Player_down1_pan.pos_x +=0.2 ;
Player_down2_pan.pos_x +=0.2 ;
Player_down3_pan.pos_x +=0.2 ;
Player_left1_pan.pos_x +=0.2 ;
Player_left2_pan.pos_x +=0.2 ;
Player_left3_pan.pos_x +=0.2 ;
Player_right1_pan.pos_x +=0.2 ;
Player_right2_pan.pos_x +=0.2 ;
Player_right3_pan.pos_x +=0.2 ;

}
wait (1);

}
}



function main()
{
video_mode = 7;
move();
}



Ok i tried to put:
"Player_up1_pan.VISIBLE = ON;"
in the part by the key, but it dont work...
Please help me.


Kokirikind

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Kokirikind] #242601
12/24/08 14:22
12/24/08 14:22
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Quote:
"Player_up1_pan.VISIBLE = ON;"

this is in c-script.

in lite-c, use "set(Player_up1_pan, VISIBLE);"

and if you want to reset the flag, use "reset(Player_up1_pan, VISIBLE);"

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Cowabanga] #242602
12/24/08 14:26
12/24/08 14:26
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
BTW, what's your version??

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Cowabanga] #242604
12/24/08 14:30
12/24/08 14:30
Joined: Dec 2008
Posts: 16
Kokirikind Offline OP
Newbie
Kokirikind  Offline OP
Newbie

Joined: Dec 2008
Posts: 16
hm ok i tried:

if(key_cuu)
{
Player_up1_pan.pos_y -=0.2 ;
Player_up2_pan.pos_y -=0.2 ;
Player_up3_pan.pos_y -=0.2 ;
Player_down1_pan.pos_y -=0.2 ;
Player_down2_pan.pos_y -=0.2 ;
Player_down3_pan.pos_y -=0.2 ;
Player_left1_pan.pos_y -=0.2 ;
Player_left2_pan.pos_y -=0.2 ;
Player_left3_pan.pos_y -=0.2 ;
Player_right1_pan.pos_y -=0.2 ;
Player_right2_pan.pos_y -=0.2 ;
Player_right3_pan.pos_y -=0.2 ;
set(Player_up1_pan, VISIBLE);
set(Player_down1_pan, INVISIBLE);

but that dont work... can u maybe tell me why ?

Ps: sorry about my bad english, i'm from the swiss.

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Kokirikind] #242606
12/24/08 14:31
12/24/08 14:31
Joined: Dec 2008
Posts: 16
Kokirikind Offline OP
Newbie
Kokirikind  Offline OP
Newbie

Joined: Dec 2008
Posts: 16
erm my version is just the Demo...
its 7.10.1...

Last edited by Kokirikind; 12/24/08 14:33.
Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Kokirikind] #242608
12/24/08 14:35
12/24/08 14:35
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
The "INVISIBLE" is still wrong, there is no such flag for a panel, you must reset the VISIBLE flag as Cowabanga told you.

Thats probably why you dont see the other panel that is covered by it.

The rest looks ok though.

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Tobias] #242610
12/24/08 14:38
12/24/08 14:38
Joined: Dec 2008
Posts: 16
Kokirikind Offline OP
Newbie
Kokirikind  Offline OP
Newbie

Joined: Dec 2008
Posts: 16
erm sorry i dont understand, how i can reset it...

Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Kokirikind] #242611
12/24/08 14:40
12/24/08 14:40
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
reset( panel, VISIBLE );


Click and join the 3dgs irc community!
Room: #3dgs
Re: Change a pannel to VISIBLE by press a key: Help me please [Re: Joozey] #242616
12/24/08 14:43
12/24/08 14:43
Joined: Dec 2008
Posts: 16
Kokirikind Offline OP
Newbie
Kokirikind  Offline OP
Newbie

Joined: Dec 2008
Posts: 16
YEAAA Thanks You all verry much now it works smile
btw: Merry chistmas^^


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