Author Topic: Shooting gallery  (Read 1496 times)

0 Members and 1 Guest are viewing this topic.

bok

  • Guest
Shooting gallery
« on: September 23, 2001, 11:40:56 AM »
Hi, another problem:
I try to turn a room into some kind of shooting-gallery. I have 5 guys running around with the
wander(ox);
-command and a crosshair-view for the ego.
now how can i check if the crosshair is somewhere near the guys? i have all the coordinates from the guys which i got by
get.posn(ox,vx,vy);
but i cant use commands like
if posn    or
if center.posn
because i can only compare the coordinates to integers and not to vars.
what can i do?
bok
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »



Offline bokkers

Re: Shooting gallery
« Reply #1 on: September 24, 2001, 02:37:39 AM »
Hi everybody,
I found out myself how to set up some "shooting-gallery" last night. For anyone of you interested, here's the code for a room with 3 guys running around, waiting to be shot:

#include "defines.txt"

if (new_room) {
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »

briancorr

  • Guest
Re: Shooting gallery
« Reply #2 on: September 26, 2001, 12:21:00 AM »
tat looks good i might try it out sometime.

just a tip though - instead of using commands like:

subv(vX,vY);

just write vX - vY = vX
or vX -= vY

also instead of

if(greaterv(vX,vY)){

use

if(vX > vY){

its easier and far less confusing
« Last Edit: December 31, 1969, 07:00:00 PM by 1018072800 »


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.044 seconds with 21 queries.