Add Blocks

Learn how to create an awesome online soccer game!

1. Upload an block images to the Assets folder in Repl
  1. Find the downloaded images. Need help?
  2. Open the asset folder in repl, click: code > client > asset
  3. Click and drag your files into this folder. Make sure your files are named something very easy and obvious (it is best to not use spaces or symbols), for example “zombies.png” or “shark.png”.

2. in game.js, Add StoreItem’s inside the useStore function.
code/client/src/game.js

		new g.StoreItem('block3.png', '3 Block', 'Points', 3, 'buy3'),
		new g.StoreItem('block5.png', '5 Block', 'Points', 4, 'buy5'),


3. in room.js, Create the Buy Actions in the actions.
code/client/src/game.js

	buy3: () => g.purchase(player, 'score', 3, 'block3s', 1),
	buy5: () => g.purchase(player, 'score', 4, 'block5s', 1),


Download your zip, and upload it to blobbert.io, and you should be able to buy blocks!


Add Scoring A Goal
Place Blocks

Need Help?

Proofread your code, check with your team and classmates, and if you’re still stuck!

Click Here for Help