Gamestudio Links
Zorro Links
Newest Posts
Why Zorro supports up to 72 cores?
by 11honza11. 04/26/24 08:55
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, Quad, 1 invisible), 837 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Keeping distance #464957
03/20/17 12:43
03/20/17 12:43
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I have astroids in my game that use the same pointer what would
be the best way so they always stay on a certain distance from
each other ?

Thank you for your time laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Keeping distance [Re: Realspawn] #464959
03/20/17 13:34
03/20/17 13:34
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
How do you move your asteroids?
If you move them through e.g. c_move, you can just increase the bounding box your asteroids (scale than c_setminmax than shrink to original size , or just vec_scale min_x and max_x manually). Also setting the GLIDE flag in your c_move function helps (also take a look at move_friction in the manual).

A better way perhaps would be adding a EVENT_IMPACT to your asteroids that when they make contact with each other (e.g. through c_move) they move away from each other (just compare the positions of both asteroids to calculate the velocity you want and e.g. save these in the asteriods' skills and than in the asteroid's c_move use these skill values).

Another way but maybe overkill solution would be implementing a flocking system.


Last edited by Reconnoiter; 03/20/17 13:37.
Re: Keeping distance [Re: Reconnoiter] #464961
03/20/17 15:06
03/20/17 15:06
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
There not moving but appear at random places
that impact sounds like a solution i will toy with it some more.
i fixed the issue thx for pointing me in the right direction laugh


Last edited by Realspawn; 03/20/17 15:10.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain

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