Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
pong.qc File Reference
#include "pong.qh"
Include dependency graph for pong.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

vector box_nearest (vector box_min, vector box_max, vector p)
void pong_add_score (entity minigame, int team_thrower, int team_receiver, int delta)
entity pong_ai_spawn (entity paddle)
void pong_ai_think (entity this)
void pong_ball_reset (entity ball)
void pong_ball_think (entity this)
void pong_ball_throw (entity ball)
void pong_ball_throwthink (entity this)
bool pong_goal (entity ball, int pteam)
void pong_paddle_bounce (entity ball, int pteam)
bool pong_paddle_hit (entity ball, int pteam)
entity pong_paddle_spawn (entity minigame, int pl_team, entity real_player)
void pong_paddle_think (entity this)
int pong_server_event (entity minigame, string event,...)
vector pong_team_to_box_halfsize (int nteam, float length, float width)
vector pong_team_to_paddlepos (int nteam)
 REGISTER_MINIGAME (pong, _("Pong"))

Variables

float autocvar_sv_minigames_pong_ai_thinkspeed
float autocvar_sv_minigames_pong_ai_tolerance
float autocvar_sv_minigames_pong_ball_number
float autocvar_sv_minigames_pong_ball_radius
float autocvar_sv_minigames_pong_ball_speed
float autocvar_sv_minigames_pong_ball_wait
float autocvar_sv_minigames_pong_paddle_size
float autocvar_sv_minigames_pong_paddle_speed
entity pong_ai_paddle
const int PONG_KEY_BOTH = 0x03
const int PONG_KEY_DECREASE = 0x02
const int PONG_KEY_INCREASE = 0x01
int pong_keys
float pong_length
const int PONG_MAX_PLAYERS = 4
entity pong_paddles [PONG_MAX_PLAYERS]
int pong_score
const int PONG_SF_BALLTEAM = MINIG_SF_CUSTOM
const int PONG_SF_PLAYERSCORE = MINIG_SF_CUSTOM
const int PONG_SPECTATOR_TEAM = 255
const int PONG_STATUS_PLAY = 0x0020
const int PONG_STATUS_WAIT = 0x0010

Function Documentation

◆ box_nearest()

vector box_nearest ( vector box_min,
vector box_max,
vector p )

Definition at line 97 of file pong.qc.

98{
99 return vec2( p.x > box_max.x ? box_max.x : ( p.x < box_min.x ? box_min.x : p.x ),
100 p.y > box_max.y ? box_max.y : ( p.y < box_min.y ? box_min.y : p.y ) );
101}
#define vec2(...)
Definition vector.qh:90

References vec2, and vector.

Referenced by pong_paddle_hit().

◆ pong_add_score()

void pong_add_score ( entity minigame,
int team_thrower,
int team_receiver,
int delta )

Definition at line 77 of file pong.qc.

78{
79 if ( !minigame )
80 return;
81
82 if ( team_thrower == 0 )
83 team_thrower = team_receiver;
84
85 if ( team_thrower == team_receiver )
86 delta *= -1;
87
88 entity paddle_thrower = minigame.pong_paddles[team_thrower-1];
89 if ( paddle_thrower.realowner.minigame_players )
90 {
91 paddle_thrower.realowner.minigame_players.pong_score += delta;
92 paddle_thrower.realowner.minigame_players.SendFlags |= PONG_SF_PLAYERSCORE;
93 }
94}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const int PONG_SF_PLAYERSCORE
Definition pong.qc:10

References entity(), and PONG_SF_PLAYERSCORE.

Referenced by pong_goal().

◆ pong_ai_spawn()

entity pong_ai_spawn ( entity paddle)

Definition at line 261 of file pong.qc.

262{
263 entity ai = msle_spawn(paddle.owner,new(pong_ai));
264 ai.minigame_players = ai;
265 ai.team = paddle.team;
267 ai.nextthink = time;
268 ai.pong_ai_paddle = paddle;
269
270 paddle.realowner = ai;
271
272 return ai;
273}
float time
entity msle_spawn(entity minigame_session, entity e)
Definition minigames.qc:87
void pong_ai_think(entity this)
Definition pong.qc:211
#define setthink(e, f)

References entity(), msle_spawn(), pong_ai_think(), setthink, and time.

Referenced by pong_paddle_spawn(), and pong_server_event().

◆ pong_ai_think()

void pong_ai_think ( entity this)

Definition at line 211 of file pong.qc.

212{
214 this.nextthink = time + think_speed;
215
216 float distance;
217 float next_distance;
218 float min_distance = 1;
219 entity ball = NULL;
220 entity mayball = NULL;
221 while ( ( mayball = findentity(mayball,owner,this.owner) ) )
222 if ( mayball.classname == "pong_ball" )
223 {
224 distance = vlen(mayball.origin-this.pong_ai_paddle.origin);
225 next_distance = vlen(mayball.origin+mayball.velocity-this.pong_ai_paddle.origin);
226 if ( distance < min_distance && ( distance < 0.5 || next_distance < distance ) )
227 {
228 min_distance = distance;
229 ball = mayball;
230 }
231 }
232
233 float target = 0.5;
234 float my_pos;
235
236
237 if ( this.team <= 2 )
238 {
239 if ( ball )
240 target = ball.origin_y + ball.velocity_y*think_speed;
241 my_pos = this.pong_ai_paddle.origin_y;
242 }
243 else
244 {
245 if ( ball )
246 target = ball.origin_x + ball.velocity_x*think_speed;
247 my_pos = this.pong_ai_paddle.origin_x;
248 }
249
252
253 if (target < my_pos - distance)
255 else if (target > my_pos + distance)
257 else
258 this.pong_keys = 0;
259}
entity owner
Definition main.qh:87
int team
Definition main.qh:188
float nextthink
entity findentity(entity start,.entity field, entity match)
float vlen(vector v)
float autocvar_sv_minigames_pong_paddle_speed
Definition pong.qc:31
int pong_keys
Definition pong.qc:23
const int PONG_KEY_INCREASE
Definition pong.qc:15
entity pong_ai_paddle
Definition pong.qc:26
float autocvar_sv_minigames_pong_ai_thinkspeed
Definition pong.qc:38
const int PONG_KEY_DECREASE
Definition pong.qc:16
float autocvar_sv_minigames_pong_ai_tolerance
Definition pong.qc:39
float pong_length
Definition pong.qc:25
#define NULL
Definition post.qh:14
string target
Definition triggers.qh:55

References autocvar_sv_minigames_pong_ai_thinkspeed, autocvar_sv_minigames_pong_ai_tolerance, autocvar_sv_minigames_pong_paddle_speed, entity(), findentity(), nextthink, NULL, owner, pong_ai_paddle, PONG_KEY_DECREASE, PONG_KEY_INCREASE, pong_keys, pong_length, target, team, time, and vlen().

Referenced by pong_ai_spawn().

◆ pong_ball_reset()

void pong_ball_reset ( entity ball)

Definition at line 65 of file pong.qc.

66{
67 ball.velocity = '0 0 0';
68 ball.origin = '0.5 0.5 0';
70 ball.team = 0;
71 ball.SendFlags |= MINIG_SF_UPDATE|PONG_SF_BALLTEAM;
74}
const int MINIG_SF_UPDATE
Definition minigames.qh:109
const int PONG_SF_BALLTEAM
Definition pong.qc:12
float autocvar_sv_minigames_pong_ball_wait
Definition pong.qc:33
void pong_ball_throwthink(entity this)
Definition pong.qc:59
void SUB_NullThink(entity this)
Definition subs.qc:3

References autocvar_sv_minigames_pong_ball_wait, entity(), MINIG_SF_UPDATE, pong_ball_throwthink(), PONG_SF_BALLTEAM, setthink, SUB_NullThink(), and time.

Referenced by pong_goal(), and pong_server_event().

◆ pong_ball_think()

void pong_ball_think ( entity this)

Definition at line 155 of file pong.qc.

156{
157 float think_speed = autocvar_sys_ticrate;
158 this.nextthink = time + think_speed;
159
160 this.origin_x += this.velocity_x * think_speed;
161 this.origin_y += this.velocity_y * think_speed;
163
164 int i;
165 for ( i = 1; i <= PONG_MAX_PLAYERS; ++i )
166 if ( pong_paddle_hit(this, i) )
167 {
168 pong_paddle_bounce(this,i);
169 this.team = i;
171 return;
172 }
173
174 if ( this.origin_y <= this.pong_length )
175 {
176 if ( !pong_goal(this,3) )
177 {
178 this.origin_y = this.pong_length;
179 this.velocity_y *= -1;
180 }
181 }
182 else if ( this.origin_y >= 1-this.pong_length )
183 {
184 if ( !pong_goal(this,4) )
185 {
186 this.origin_y = 1-this.pong_length;
187 this.velocity_y *= -1;
188 }
189 }
190
191 if ( this.origin_x <= this.pong_length )
192 {
193 if ( !pong_goal(this,2) )
194 {
195 this.origin_x = this.pong_length;
196 this.velocity_x *= -1;
197 }
198 }
199 else if ( this.origin_x >= 1-this.pong_length )
200 {
201 if ( !pong_goal(this,1) )
202 {
203 this.origin_x = 1-this.pong_length;
204 this.velocity_x *= -1;
205 }
206 }
207
208}
int SendFlags
Definition net.qh:118
bool pong_goal(entity ball, int pteam)
Definition pong.qc:138
const int PONG_MAX_PLAYERS
Definition pong.qc:20
bool pong_paddle_hit(entity ball, int pteam)
Definition pong.qc:122
void pong_paddle_bounce(entity ball, int pteam)
Definition pong.qc:103
float autocvar_sys_ticrate
Definition main.qh:17

References autocvar_sys_ticrate, entity(), MINIG_SF_UPDATE, nextthink, pong_goal(), pong_length, PONG_MAX_PLAYERS, pong_paddle_bounce(), pong_paddle_hit(), PONG_SF_BALLTEAM, SendFlags, team, and time.

Referenced by pong_ball_throw().

◆ pong_ball_throw()

void pong_ball_throw ( entity ball)

Definition at line 44 of file pong.qc.

45{
46 float angle;
47 do
48 angle = random() * (2 * M_PI);
49 while ( fabs(sin(angle)) < 0.17 || fabs(cos(angle)) < 0.17 );
53 ball.nextthink = time;
54 ball.team = 0;
55 ball.SendFlags |= MINIG_SF_UPDATE|PONG_SF_BALLTEAM;
56}
float angle
Definition viewloc.qc:114
#define M_PI
Definition mathlib.qh:108
float cos(float f)
float random(void)
float sin(float f)
float fabs(float f)
void pong_ball_think(entity this)
Definition pong.qc:155
float autocvar_sv_minigames_pong_ball_speed
Definition pong.qc:34

References angle, autocvar_sv_minigames_pong_ball_speed, cos(), entity(), fabs(), M_PI, MINIG_SF_UPDATE, pong_ball_think(), PONG_SF_BALLTEAM, random(), setthink, sin(), and time.

Referenced by pong_ball_throwthink().

◆ pong_ball_throwthink()

void pong_ball_throwthink ( entity this)

Definition at line 59 of file pong.qc.

60{
61 pong_ball_throw(this);
62}
void pong_ball_throw(entity ball)
Definition pong.qc:44

References entity(), and pong_ball_throw().

Referenced by pong_ball_reset().

◆ pong_goal()

bool pong_goal ( entity ball,
int pteam )

Definition at line 138 of file pong.qc.

139{
140 entity paddle = ball.owner.pong_paddles[pteam-1];
141 if (!paddle)
142 return false;
143
144 if ( !pong_paddle_hit(ball, pteam) )
145 {
146 pong_add_score(ball.owner ,ball.team, pteam, 1);
147 pong_ball_reset(ball);
148 return true;
149 }
150
151 return false;
152}
void pong_add_score(entity minigame, int team_thrower, int team_receiver, int delta)
Definition pong.qc:77
void pong_ball_reset(entity ball)
Definition pong.qc:65

References entity(), pong_add_score(), pong_ball_reset(), and pong_paddle_hit().

Referenced by pong_ball_think().

◆ pong_paddle_bounce()

void pong_paddle_bounce ( entity ball,
int pteam )

Definition at line 103 of file pong.qc.

104{
105 switch(pteam)
106 {
107 case 1: ball.velocity_x = -fabs(ball.velocity_x); break;
108 case 2: ball.velocity_x = fabs(ball.velocity_x); break;
109 case 3: ball.velocity_y = fabs(ball.velocity_y); break;
110 case 4: ball.velocity_y = -fabs(ball.velocity_y); break;
111 }
112
113 float angle = atan2(ball.velocity_y, ball.velocity_x);
114 angle += ( random() - 0.5 ) * 2 * M_PI/6;
115 float speed = vlen(ball.velocity);
116
117 ball.velocity_y = speed * sin(angle);
118 ball.velocity_x = speed * cos(angle);
119}
float speed
Definition dynlight.qc:9

References angle, cos(), entity(), fabs(), M_PI, random(), sin(), speed, and vlen().

Referenced by pong_ball_think().

◆ pong_paddle_hit()

bool pong_paddle_hit ( entity ball,
int pteam )

Definition at line 122 of file pong.qc.

123{
124 entity paddle = ball.owner.pong_paddles[pteam-1];
125 if (!paddle)
126 return false;
127
128#if 1
129 vector near_point = box_nearest(paddle.m_mins+paddle.origin,
130 paddle.m_maxs+paddle.origin, ball.origin);
131 return vdist(near_point - ball.origin, <=, ball.pong_length);
132#else
133 return boxesoverlap(paddle.m_mins + paddle.origin, paddle.m_maxs + paddle.origin, ball.m_mins + ball.origin, ball.m_maxs + ball.origin);
134#endif
135}
vector box_nearest(vector box_min, vector box_max, vector p)
Definition pong.qc:97
vector
Definition self.qh:92
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
Definition vector.qh:8
ERASEABLE float boxesoverlap(vector m1, vector m2, vector m3, vector m4)
requires that m2>m1 in all coordinates, and that m4>m3
Definition vector.qh:73

References box_nearest(), boxesoverlap(), entity(), vdist, and vector.

Referenced by pong_ball_think(), and pong_goal().

◆ pong_paddle_spawn()

entity pong_paddle_spawn ( entity minigame,
int pl_team,
entity real_player )

Definition at line 320 of file pong.qc.

321{
322 entity paddle = msle_spawn(minigame,new(pong_paddle));
323 paddle.pong_length = autocvar_sv_minigames_pong_paddle_size;
324 paddle.origin = pong_team_to_paddlepos(pl_team);
326 paddle.nextthink = time;
327 paddle.team = pl_team;
328 paddle.m_mins = pong_team_to_box_halfsize(pl_team,-paddle.pong_length,-1/16);
329 paddle.m_maxs = pong_team_to_box_halfsize(pl_team,paddle.pong_length,1/16);
330
331 if ( real_player == NULL )
332 pong_ai_spawn(paddle);
333 else
334 paddle.realowner = real_player;
335
336 minigame.pong_paddles[pl_team-1] = paddle;
337
338 return paddle;
339
340}
entity pong_ai_spawn(entity paddle)
Definition pong.qc:261
vector pong_team_to_paddlepos(int nteam)
Definition pong.qc:306
float autocvar_sv_minigames_pong_paddle_size
Definition pong.qc:30
void pong_paddle_think(entity this)
Definition pong.qc:276
vector pong_team_to_box_halfsize(int nteam, float length, float width)
Definition pong.qc:299

References autocvar_sv_minigames_pong_paddle_size, entity(), msle_spawn(), NULL, pong_ai_spawn(), pong_paddle_think(), pong_team_to_box_halfsize(), pong_team_to_paddlepos(), setthink, and time.

Referenced by pong_server_event().

◆ pong_paddle_think()

void pong_paddle_think ( entity this)

Definition at line 276 of file pong.qc.

277{
278 float think_speed = autocvar_sys_ticrate;
279 this.nextthink = time + think_speed;
280
281 if ( this.realowner.minigame_players.pong_keys == PONG_KEY_INCREASE ||
282 this.realowner.minigame_players.pong_keys == PONG_KEY_DECREASE )
283 {
284 float pmovement = autocvar_sv_minigames_pong_paddle_speed * think_speed;
285 float halflen = this.pong_length/2;
286
287 if ( this.realowner.minigame_players.pong_keys == PONG_KEY_DECREASE )
288 pmovement *= -1;
289
290 if ( this.team > 2 )
291 this.origin_x = bound(halflen, this.origin_x+pmovement, 1-halflen);
292 else
293 this.origin_y = bound(halflen, this.origin_y+pmovement, 1-halflen);
294
296 }
297}
float bound(float min, float value, float max)
entity realowner

References autocvar_sv_minigames_pong_paddle_speed, autocvar_sys_ticrate, bound(), entity(), MINIG_SF_UPDATE, nextthink, PONG_KEY_DECREASE, PONG_KEY_INCREASE, pong_length, realowner, SendFlags, team, and time.

Referenced by pong_paddle_spawn().

◆ pong_server_event()

int pong_server_event ( entity minigame,
string event,
... )

Definition at line 343 of file pong.qc.

344{
345 switch (event)
346 {
347 case "start":
348 {
349 minigame.minigame_flags |= PONG_STATUS_WAIT;
350 return true;
351 }
352 case "join":
353 {
354 // Don't allow joining a match that is already running
355 if ( minigame.minigame_flags & PONG_STATUS_PLAY )
356 return PONG_SPECTATOR_TEAM;
357
358 entity player = ...(0,entity);
359 int i;
360 for ( i = 0; i < PONG_MAX_PLAYERS; ++i )
361 {
362 if ( minigame.pong_paddles[i] == NULL )
363 {
364 pong_paddle_spawn(minigame,i+1,player);
365 return i+1;
366 }
367 }
368
369 return PONG_SPECTATOR_TEAM;
370 }
371 case "part":
372 {
373 entity player = ...(0,entity);
374 entity paddle;
375 entity ai;
376 int i;
377 for ( i = 0; i < PONG_MAX_PLAYERS; ++i )
378 {
379 paddle = minigame.pong_paddles[i];
380 if ( paddle != NULL && paddle.realowner == player )
381 {
382 ai = pong_ai_spawn(paddle);
383 ai.pong_score = player.minigame_players.pong_score;
384 break;
385 }
386
387 }
388 return false;
389 }
390 case "cmd":
391 {
392 entity player = ...(0,entity);
393 bool event_blocked = (player.team == PONG_SPECTATOR_TEAM);
394 switch(argv(0))
395 {
396 case "throw":
397 if(event_blocked)
398 return true;
399 if ( minigame.minigame_flags & PONG_STATUS_WAIT )
400 {
401 minigame.minigame_flags = PONG_STATUS_PLAY |
402 (minigame.minigame_flags & ~PONG_STATUS_WAIT);
403 minigame.SendFlags |= MINIG_SF_UPDATE;
404
405 entity ball;
406 for ( int j = 0; j < autocvar_sv_minigames_pong_ball_number; ++j )
407 {
408 ball = msle_spawn(minigame,new(pong_ball));
410 ball.m_mins = vec2(-ball.pong_length, -ball.pong_length);
411 ball.m_maxs = vec2(ball.pong_length, ball.pong_length);
412 pong_ball_reset(ball);
413 }
414 }
415 return true;
416 case "+movei":
417 if(event_blocked)
418 return true;
419 player.pong_keys |= PONG_KEY_INCREASE;
420 return true;
421 case "+moved":
422 if(event_blocked)
423 return true;
424 player.pong_keys |= PONG_KEY_DECREASE;
425 return true;
426 case "-movei":
427 if(event_blocked)
428 return true;
429 player.pong_keys &= ~PONG_KEY_INCREASE;
430 return true;
431 case "-moved":
432 if(event_blocked)
433 return true;
434 player.pong_keys &= ~PONG_KEY_DECREASE;
435 return true;
436 case "move":
437 if(event_blocked)
438 return true;
439 if(argv(1))
440 player.pong_keys = stoi(argv(1));
441 return true;
442 case "pong_aimore":
443 {
444 if(event_blocked)
445 return true;
446 // keep declaration here, moving it into for() reverses weapon order
447 // potentially compiler bug
448 int j;
449 if ( minigame.minigame_flags & PONG_STATUS_WAIT )
450 for ( j = 0; j < PONG_MAX_PLAYERS; ++j )
451 //for ( int j = 0; j < PONG_MAX_PLAYERS; ++j )
452 {
453 if ( minigame.pong_paddles[j] == NULL )
454 {
455 pong_paddle_spawn(minigame,j+1,NULL);
456 return true;
457 }
458 }
459 sprint(player.minigame_players,"Cannot spawn AI\n");
460 return true;
461 }
462 case "pong_ailess":
463 {
464 if(event_blocked)
465 return true;
466 if ( minigame.minigame_flags & PONG_STATUS_WAIT )
467 {
468 entity paddle;
469 for ( int j = PONG_MAX_PLAYERS-1; j >= 0; --j )
470 {
471 paddle = minigame.pong_paddles[j];
472 if ( paddle != NULL &&
473 paddle.realowner.classname == "pong_ai" )
474 {
475 minigame.pong_paddles[j] = NULL;
476 delete(paddle.realowner);
477 delete(paddle);
478 return true;
479 }
480 }
481 }
482 sprint(player.minigame_players,"Cannot remove AI\n");
483 return true;
484 }
485
486 }
487 return false;
488 }
489 case "network_send":
490 {
491 entity sent = ...(0,entity);
492 int sf = ...(1,int);
493 if ( sent.classname == "minigame_player" && (sf & PONG_SF_PLAYERSCORE ) )
494 {
495 WriteLong(MSG_ENTITY,sent.pong_score);
496 }
497 return false;
498 }
499 }
500 return false;
501}
#define stoi(s)
Definition int.qh:4
#define int
Definition _all.inc:20
const int MSG_ENTITY
Definition net.qh:115
void WriteLong(float data, float dest, float desto)
void sprint(float clientnum, string text,...)
string argv(float n)
float autocvar_sv_minigames_pong_ball_number
Definition pong.qc:36
float autocvar_sv_minigames_pong_ball_radius
Definition pong.qc:35
const int PONG_STATUS_PLAY
Definition pong.qc:6
entity pong_paddle_spawn(entity minigame, int pl_team, entity real_player)
Definition pong.qc:320
const int PONG_SPECTATOR_TEAM
Definition pong.qc:21
const int PONG_STATUS_WAIT
Definition pong.qc:5

References argv(), autocvar_sv_minigames_pong_ball_number, autocvar_sv_minigames_pong_ball_radius, entity(), int, MINIG_SF_UPDATE, MSG_ENTITY, msle_spawn(), NULL, pong_ai_spawn(), pong_ball_reset(), PONG_KEY_DECREASE, PONG_KEY_INCREASE, PONG_MAX_PLAYERS, pong_paddle_spawn(), PONG_SF_PLAYERSCORE, PONG_SPECTATOR_TEAM, PONG_STATUS_PLAY, PONG_STATUS_WAIT, sprint(), stoi, vec2, and WriteLong().

◆ pong_team_to_box_halfsize()

vector pong_team_to_box_halfsize ( int nteam,
float length,
float width )

Definition at line 299 of file pong.qc.

300{
301 if ( nteam > 2 )
302 return vec2(length/2, width/2);
303 return vec2(width/2, length/2);
304}

References vec2, and vector.

Referenced by pong_paddle_spawn().

◆ pong_team_to_paddlepos()

vector pong_team_to_paddlepos ( int nteam)

Definition at line 306 of file pong.qc.

307{
308 switch(nteam)
309 {
310 case 1: return '0.99 0.5 0';
311 case 2: return '0.01 0.5 0';
312 case 3: return '0.5 0.01 0';
313 case 4: return '0.5 0.99 0';
314 default:return '0 0 0';
315 }
316}

References vector.

Referenced by pong_paddle_spawn().

◆ REGISTER_MINIGAME()

REGISTER_MINIGAME ( pong ,
_("Pong")  )

Variable Documentation

◆ autocvar_sv_minigames_pong_ai_thinkspeed

float autocvar_sv_minigames_pong_ai_thinkspeed

Definition at line 38 of file pong.qc.

Referenced by pong_ai_think().

◆ autocvar_sv_minigames_pong_ai_tolerance

float autocvar_sv_minigames_pong_ai_tolerance

Definition at line 39 of file pong.qc.

Referenced by pong_ai_think().

◆ autocvar_sv_minigames_pong_ball_number

float autocvar_sv_minigames_pong_ball_number

Definition at line 36 of file pong.qc.

Referenced by pong_server_event().

◆ autocvar_sv_minigames_pong_ball_radius

float autocvar_sv_minigames_pong_ball_radius

Definition at line 35 of file pong.qc.

Referenced by pong_server_event().

◆ autocvar_sv_minigames_pong_ball_speed

float autocvar_sv_minigames_pong_ball_speed

Definition at line 34 of file pong.qc.

Referenced by pong_ball_throw().

◆ autocvar_sv_minigames_pong_ball_wait

float autocvar_sv_minigames_pong_ball_wait

Definition at line 33 of file pong.qc.

Referenced by pong_ball_reset().

◆ autocvar_sv_minigames_pong_paddle_size

float autocvar_sv_minigames_pong_paddle_size

Definition at line 30 of file pong.qc.

Referenced by pong_paddle_spawn().

◆ autocvar_sv_minigames_pong_paddle_speed

float autocvar_sv_minigames_pong_paddle_speed

Definition at line 31 of file pong.qc.

Referenced by pong_ai_think(), and pong_paddle_think().

◆ pong_ai_paddle

entity pong_ai_paddle

Definition at line 26 of file pong.qc.

Referenced by pong_ai_think().

◆ PONG_KEY_BOTH

const int PONG_KEY_BOTH = 0x03

Definition at line 17 of file pong.qc.

◆ PONG_KEY_DECREASE

const int PONG_KEY_DECREASE = 0x02

Definition at line 16 of file pong.qc.

Referenced by pong_ai_think(), pong_paddle_think(), and pong_server_event().

◆ PONG_KEY_INCREASE

const int PONG_KEY_INCREASE = 0x01

Definition at line 15 of file pong.qc.

Referenced by pong_ai_think(), pong_paddle_think(), and pong_server_event().

◆ pong_keys

int pong_keys

Definition at line 23 of file pong.qc.

Referenced by pong_ai_think().

◆ pong_length

float pong_length

Definition at line 25 of file pong.qc.

Referenced by pong_ai_think(), pong_ball_think(), and pong_paddle_think().

◆ PONG_MAX_PLAYERS

const int PONG_MAX_PLAYERS = 4

Definition at line 20 of file pong.qc.

Referenced by pong_ball_think(), and pong_server_event().

◆ pong_paddles

entity pong_paddles[PONG_MAX_PLAYERS]

Definition at line 24 of file pong.qc.

◆ pong_score

int pong_score

Definition at line 22 of file pong.qc.

◆ PONG_SF_BALLTEAM

const int PONG_SF_BALLTEAM = MINIG_SF_CUSTOM

Definition at line 12 of file pong.qc.

Referenced by pong_ball_reset(), pong_ball_think(), and pong_ball_throw().

◆ PONG_SF_PLAYERSCORE

const int PONG_SF_PLAYERSCORE = MINIG_SF_CUSTOM

Definition at line 10 of file pong.qc.

Referenced by pong_add_score(), and pong_server_event().

◆ PONG_SPECTATOR_TEAM

const int PONG_SPECTATOR_TEAM = 255

Definition at line 21 of file pong.qc.

Referenced by pong_server_event().

◆ PONG_STATUS_PLAY

const int PONG_STATUS_PLAY = 0x0020

Definition at line 6 of file pong.qc.

Referenced by pong_server_event().

◆ PONG_STATUS_WAIT

const int PONG_STATUS_WAIT = 0x0010

Definition at line 5 of file pong.qc.

Referenced by pong_server_event().