Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,248 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How i can manage collisions ? #221694
08/15/08 15:06
08/15/08 15:06
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
Hi, i need something like that in code-form:
"when the player collides with the wall(or everything that is solid), he can jump"
I haven't found examples or tutorials that show how i can manage this whole collisions thing.
PS: My player is a model and the wall is a wed-block (is that a problem ?)


Last edited by theDust; 08/15/08 15:07.
Re: How i can manage collisions ? [Re: theDust] #221744
08/15/08 23:35
08/15/08 23:35
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
If you use "c_move" add "glide" to "var mode".
If you use "ent_move" add "glide" to move_mode. (move_mode = ignore_passable + glide;)


Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: How i can manage collisions ? [Re: cro_games] #221773
08/16/08 09:28
08/16/08 09:28
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
I move my player with physics. Anyway, i need a if-shape.

action player ()
...
if(collision...)
{
...
}

I don't now if "glide" can help me in this case.

Re: How i can manage collisions ? [Re: theDust] #221777
08/16/08 10:51
08/16/08 10:51
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
You didn't say that:

you can use
Code:
ph_setcollisions



Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: How i can manage collisions ? [Re: cro_games] #221786
08/16/08 13:04
08/16/08 13:04
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
Ähm, you dont understand me (or I dont understand you wink ). I dont want to modify the collision. I need a piece of code that detects when the collision happens and when not. I have no idea how to use ph_setcollisions for my needs.


Last edited by theDust; 08/16/08 13:40.
Re: How i can manage collisions ? [Re: theDust] #221808
08/16/08 14:35
08/16/08 14:35
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
Yes,i didn't understand you:

c-scripts:
my.enable_entity = on;
my.enable_block = off;
my.event = function_name;//when the collision happens call function


lite-c:
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); sensitive for block and entity collision
my.event = function_name;//when the collision happens call function


Last edited by cro_games; 08/16/08 14:37.

Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: How i can manage collisions ? [Re: cro_games] #221918
08/16/08 23:06
08/16/08 23:06
Joined: Mar 2008
Posts: 104
theDust Offline OP
Member
theDust  Offline OP
Member

Joined: Mar 2008
Posts: 104
It works, thank you for your help smile

Re: How i can manage collisions ? [Re: theDust] #221935
08/17/08 00:58
08/17/08 00:58
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
No problem man,any time..


Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Re: How i can manage collisions ? [Re: cro_games] #224449
08/30/08 08:20
08/30/08 08:20
Joined: Dec 2004
Posts: 35
Germany
F
Fanatiker Offline
Newbie
Fanatiker  Offline
Newbie
F

Joined: Dec 2004
Posts: 35
Germany
Hi, i am using c-lite and have a problem with collisions too.

I want to use a polygon hull for my player.
But i get always an error.

i copied this 2 lines from the online manual in my file:
my.polygon = on;
set(my,polygon);

if i start the enngine says:
polygon is not a member of ENTITY

maybe someone has an idea ?


Code:

var walk_percentage;

function move()
{
	camera.y = me.y;
	c_move(me,vector((key_d - key_a) * 5 * time_step,0,0),nullvector,GLIDE);	
	ent_animate(me, "walk", walk_percentage, ANM_CYCLE); 									// "walk" Animations-Loop
   walk_percentage += (key_d - key_a) * 10 * time_step; 															// 3 = Animationsgeschwindigkeit für "walk"
}

function jump()
{
	c_move(me,vector(0,0,5*time_step),nullvector,GLIDE);
}

action spieler()
{	
	my.polygon = on;	
	set(my,polygon);
	//my.NARROW = ON;    //Kollisionshülle in Form einer Kugel im Zentrum der Figur
	//my.FAT = ON; 
	//my.NARROW = ON;
	//my.eflags &= ~FAT;
	//my.efalgs |= NARROW;		// Eine zylindrische Kollisionshülle	
	camera.x = 1000; // halte d. Kamera 300 Quants hinter d. Ball
	camera.y = me.y; // verwende dasselbe y wie mit d. Ball
	camera.z = 600; // und plaziere sie bei z = 1000 Quants
   camera.pan = 180;
   camera.tilt = -30;
	
	while(1)
	{
 		if(key_d == 1)move();
		if(key_a == 1)move();
		if(key_w == 1)jump();
		wait(1);
	}	
}


Re: How i can manage collisions ? [Re: Fanatiker] #224545
08/30/08 19:53
08/30/08 19:53
Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
cro_games Offline
User
cro_games  Offline
User

Joined: Sep 2007
Posts: 761
Hrvatska (Croatia ), Slavonski...
It is lite-c and right code is "set(my,POLYGON);" not "set(my,plygon); and my.plygon = on;".
Lite-c knows diffrence between BIG and small letters..

Last edited by cro_games; 08/31/08 07:56.

Hello everyone my name is Ivan Mandic from "Frozen pixel studio". wink
-----------------------------------
Homepage: www.fpx-studio.com
e-mail: emu_hunter_1990@hotmail.com
(working on a game engine)
Page 1 of 2 1 2

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