Friday, March 1, 2024

Character P.Object



Lets say we want to add a shop in C++:

get the game, standard variables:
[code]
extern char character;
extern int character_id;
extern char character_name[2];
extern int character_age;
extern char character_gender;
extern char character_title;
extern char character_image;
extern int character_3d_model;
extern int character_inventory;
extern int character_items[100]; //link
extern int character_spells[100]; //link
extern int character_abilitys[100]; //link
extern int character_status;
char character_race;
char character_type; // Npc, player
int character_inventory_size;
char character_background; // History
char character_family; // History

char character_language;
char character_language_list = {"common", "orcish"};

int character_health;
int character_max_health;
int character_mana;
int character_max_mana;
int character_stamina;
int character_max_stamina;
int character_damage[2]; // min, max
int character_level;
int character_level_value;
float character_level_up = 0.3;
int character_level_up =
int character_level_ = 0.2;
int character_xp;
int character_xp_level_up;

int shop_id;
int shop_name;
char shop_npc;
int shop_money;
int shop_timer;
int shop_time;
char shop_items;
int shop_slots;
int shop_menus;

int item_id;
extern char items[];
int item_name;
int item_menu[100];

[/code]

How it looks in objects :

new object = shop;
new object = character;
new object = item;

shop->interface;
shop->load_items;
shop->buy;
shop->sell;

character->money;
character->status;
character->unequip;

item->effect;

game interface procedural;

A costume object in this. It alter the state of variables.  Width out affecting the code. You only need the standard variables.

In next version they will be in just one file for better readability.

To store in this case you may need the costume storage or save, or you can build yours.

in this case, character_array_index; It have the "register" or "matrix" for the save. It will also be global.

is not that hard. Main is a bit confusing, but it is suppose to be like MVC, you load stuff in to it. You can even have a file
width this objects, and load/#include the file. It to your zone or city to buy.

Study? Not that much, since main is modular, you can use it, width out any more code.

No comments:

Post a Comment

hi

Rules

Rules, Steps & methods This is the current way to implement and be implemented but there could be more things to add : Root or loader  (...