Discuss Scratch

stevetheplayer525
Scratcher
100+ posts

How do i make a game keep track of items?

Im making a metroidvania style platformer, and of course, one aspect of a metroidvania is collecting items. However, I dont know how to make the game keep track of what the item is, and what its supposed to do, It could really help if someone could tell me how to do something like this!
KateThePup
Scratcher
100+ posts

How do i make a game keep track of items?

Try adding in a list. If you grab an item, it would put it in the list to keep track.
--Moonstone---
New Scratcher
3 posts

How do i make a game keep track of items?

You can make a different sprite with the items.
You could do if costume number is = to ____ then set variable ___ to ____ in the items sprite.
Then in the player sprite you could do if variable ___ is = to ___ then ____.
DragonFire973
Scratcher
73 posts

How do i make a game keep track of items?

so you can have a list, maybe if you are able to get multiple of the same item and stack them, the list should look like this:

0 #

repeat that for the amount of items you are able to hold, the 0 stands for the items number which can be used to set its costume, and the # stands for the number of items.

when you pick up an item have it check to see if the list has the items number already, if so change the value next to the items number, if not set 0 of list + 1 with 1 and 0 of list with the costume number of the item you picked up. you can then have a list with coordinates of where each slot of the list will appear and use that to set the costume in that spot, and that should work. For using up items just find the items number in the list, +1 and add -1 to that position in the list, and then check if that number is now 0. If it is set it to # and then that position -1 set to 0…
superstargamer360
Scratcher
4 posts

How do i make a game keep track of items?

iftouching item?thenadditemtolist

Powered by DjangoBB