I have been playing around creating a brawl-like platformer game and currently stuck. Wanting to have 4 characters to choose from, each with its own animation as well as instance variables (e.g. run speed, jump speed).
Method: (learnt from link below)
One player object (invisible rectangle) + one animation object that consist of all characters' sprites. Using a global variable to call out corresponding sprites. This method can achieve 4 different character looks, but since it is essentially based on the same object, they all have the same instance variables. Am I missing something?
What is the best way to achieve 4 different characters, each with varying properties?
*sorry can't seem to insert hyperlink:
Develop games in your browser. Powerful, performant & highly capable.
Hi, you can use another variable on the object to identify it as a player. For example, in events if object.char=1, set the rest of the variables to a,b,c etc. If object.char=2, set the rest of the variables to d,e,f etc. You can also then refer to specific character types elsewhere in conditions like this, where object.char=1 is always character type 1.