Thank you for this. I have to say I'm quite new at programming in general so please excuse my ignorance. I've been having a go at this but I can't seem to find out how to add all that data into a single dictionary to pull it out again as you've shown.
Imagine I have a dictionary called powerups
.
I can do this kind of thing:
var powerUpDict = {
powerUpName = "speedUpBat",
batSpeedChange = 10,
ballSpeedChange = 0,
freezeBat = false,
doublePoints = false,
spawnRandomPowerup = false
}
But how can I add ANOTHER powerup to that dictionary so I can have them all within it? My understanding is if I do something like:
var powerUpDict = {
powerUpName = "speedUpBat",
batSpeedChange = 10,
ballSpeedChange = 0,
freezeBat = false,
doublePoints = false,
spawnRandomPowerup = false,
powerUpName = "slowDownBat",
batSpeedChange = -10,
ballSpeedChange = 0,
freezeBat = false,
doublePoints = false,
spawnRandomPowerup = false
}
... then I will have overwritten the duplicate named entries. Is that correct? I wonder if someone wouldn't mind pointing me in the right direction.
Anything to help, thank you :-)