- Online Community Forums » Programming Questions » A new design pattern

This thread is locked; no one can reply to it. rss feed Print
A new design pattern
Member #16,794
January 2018

I use this model to distinguish between different players.
But, you know, I am a learner, I do not expect excessively high efficiency.
I just want to know, is it feasible?
Can he tell the difference between different players?

C + + entry, obviously can not tell me.I need a living enthusiastic person.

if (player_bullet_num_max[player_id] == 35) {
    bulxyl_01[gun_id[player_id]][player_id][(Bullet_box_num[gun_id[player_id]][player_id] - 1)].bullet_hp = 100;
    bulxyl_01[gun_id[player_id]][player_id][(Bullet_box_num[gun_id[player_id]][player_id] - 1)].bullet_x = /*gun x*/;
    bulxyl_01[gun_id[player_id]][player_id][(Bullet_box_num[gun_id[player_id]][player_id] - 1)].bullet_y = /*gun y*/;
    bulxyl_01[gun_id[player_id]][player_id][(Bullet_box_num[gun_id[player_id]][player_id] - 1)].bullet_arc = /*gun arc*/;

Member #2,229
April 2002

For shooting bullets, I would create a list of bullets and everytime you shoot, add that bullet to the list. The list could contain all the information you need about each bullet if need be.

I am a C programmer, and have my own vector style implementation for C. For C++ you could use vector's to easily add new bullets to a list.

Deluxe Pacman 2 game and source code

Member #16,794
January 2018

@Neil Roy

Luckily, we have a common idea. :)
This is only part of "numerical transfer".I created a separate array for use throughout.

Go to: