I'm currently making a game with three powers players can swap between but it stays with one ability despite my attempt at making them able to swap
Pretty much just a global variable set to 0, 1 or 2 and then with the key presses for abilities you use condition global variable = 0, 1 or 2.
Develop games in your browser. Powerful, performant & highly capable.
what you need to do is have a gloal variable and if it equals 0 its 1 power if it equals 2 its anoter if it equals 3 another and so on then have an event to log key presses e.g
on key A pressed set variable to 0
do this for all powerups
then say if global variable = 0 set player animations etc and toggle that powerups events