Gamestudio Links
Zorro Links
Newest Posts
How to buy tomorrow at open?
by frutza. 06/01/23 19:58
Adding Position to Current Trade
by AndrewAMD. 05/30/23 10:34
Unable to change multiplier of contract
by vicknick. 05/30/23 06:56
Wrong Definition of Sharpe Ratio in Zorro?
by vicknick. 05/29/23 06:32
Backtest strategy on bitcoin/crypto
by JamesHH. 05/26/23 04:36
Return type of floor()
by AndrewAMD. 05/25/23 14:17
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (AndrewAMD), 1,065 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
BInnacle, androsa, XquicksnowX, danishinvest, Trail
18942 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
PLZ help: collision detection #102125
12/14/06 16:38
12/14/06 16:38
Joined: Dec 2006
Posts: 2
B
Bam Offline OP
Guest
Bam  Offline OP
Guest
B

Joined: Dec 2006
Posts: 2
PLZ help me with advice(or better piece of source code):

1. how to detect if me. entity(Player) has collided with sprite called 'SPRITE1'?

2. in my game camera is behind player.When player is standing with backside to the wall than it hapens that camera now is in the wall, and sprite entities from game dissapear. How to solve this problem?

Thanks!

Re: PLZ help: collision detection [Re: Bam] #102126
12/14/06 16:49
12/14/06 16:49
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
simple answer to wuestion nr 1

function collision
{
if(event_type == event_impact && player == you)
beep();
}

action sprite // this action to the sprite
{
my.enable_impact = on;
my.event = collision;
}

entity* player;
action player_move // this is the players action
{
player = me;
my.enable_impact = on;
while(1)
{
ent_move(me,vector(10*time,0,0),nullvector);
wait(1);
}
}

and for the second question you need camera collusion
sorry but I cant script it to you


Visit:
schwenkschuster-design.de
Re: PLZ help: collision detection [Re: aztec] #102127
12/14/06 17:43
12/14/06 17:43
Joined: Dec 2006
Posts: 2
B
Bam Offline OP
Guest
Bam  Offline OP
Guest
B

Joined: Dec 2006
Posts: 2
TNX aztec!
Main goal of 1. question was to detect if car(me entity) has crossed the finish/start line and I thought maybe to make finish/start line as passable sprite.

Is it actually possible to detect collision and at the next moment drive through it(finish/start sprite)?

Please don't get mad at me if I have wrong solution. Correct me if I'am wrong.

Re: PLZ help: collision detection [Re: Bam] #102128
12/14/06 18:28
12/14/06 18:28
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
can really say how to script that i think its a bit more diffiuclt
there was something about an Car Ai in the aum and in the new aum there will be such a Lap Panel so you jsut ahve to wait^^
>Regards
Aztec


Visit:
schwenkschuster-design.de
Re: PLZ help: collision detection [Re: aztec] #102129
12/17/06 07:01
12/17/06 07:01
Joined: Aug 2006
Posts: 128
Papua New Guinea
I
Impaler Offline
Member
Impaler  Offline
Member
I

Joined: Aug 2006
Posts: 128
Papua New Guinea
Actually, I think that's pretty simple:
just make the sprite not passable and as soon as it touches the car make it passable. then sleep(5); and make it not passable again. Or you could trace a vector up from the sprite to detect the car.


Murphey's Law:
<< if anything can go wrong, it will >>

(Murphey was an optimist).
Re: PLZ help: collision detection [Re: Impaler] #102130
12/17/06 07:38
12/17/06 07:38
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
but then the player could just drive backwards over the finish


Visit:
schwenkschuster-design.de

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