So this student programs a score 1 and score 2 with separate counting for each one. How ever if one sprite touches the target they both score the same . The game is designed that the players can touch each other for points. Its a tag game.
Welcome to the forum! We’re glad to have you. If you could post the share link for this project one of us would be happy to help debug whatever is going on with this project.
The basic solution is that you have 2 different if statements and 2 different variables. I am not sure how you are differentiating when a point is added to score1 vs score2. The pseudocode might look like this if I understand your problem:
var score1 = 0
var score2=0
if sprite1 touches target - add one to score1.
if sprite2 touches target - add one to score2.
I am not able to see the student’s code. The link you provided is a link to the assignment/activity but not to the specific project. If the above tips did not help solve the issue, can you provide a link to the project by clicking on the button.
~Michelle
Ok I opened the SHARE, but I don’t know where a different link would be.
https://studio.code.org/s/interactive-games-animations-2024/lessons/28/levels/7?user_id=123802734
- From the student’s project, click the
button.
- Click the
button.
- Paste that link as a reply to this post.