[ad_1]
I’m engaged on a text-based MUD (Multi-User-Dungeon) in C++, however an important factor in a MUD is the MU (Multi-User). Is there any simple solution to implement these mechanics? I need a participant on one shopper to deal injury to an enemy, and that enemy to lose HP on the opposite shoppers. Here’s an instance of what I’d wish to occur.
Client 1:
Demon HP: [####################]
You used SWORD on DEMON!
Demon HP: [##################--]
Client 2:
Demon HP: [####################]
User1 used SWORD on DEMON!
Demon HP: [##################--]
I can do this, however the arduous half is the underlying bits (because it all the time is). I want shopper one to replace the demon’s HP, and that to register on shopper two. Sort of like this.
Client 1
int DemonHP = 10;
DemonHP = DemonHP - 2;
ship(DemonHP)
Client 2
int DemonHP = 10;
//Client 1 calls ship(DemonHP)
//At this level, DemonHP ought to equal 8
This is the idea of a multiplayer expertise.
To make clear, I perceive that ship(var)
just isn’t correct C++ notation, the query is what the correct notation would be.
[ad_2]