Help me help this student!



My student is trying to touch the watermelon with the giraffe and have the watermelon move after being “eaten”/touched. The watermelon just moves super fast and we can’t seem to slow it down or get it to do what he wants when the giraffe touches it. Here is the code:

// Create your variables here
var character = createSprite(200, 200);
character.scale = 0.3;
var watermelon = createSprite(200, 200);
watermelon.scale = 0.2;

// Create your sprites here

function draw() {
// draw background
text(“Space to jump, Arrows to move,get the watermelon”, 0, 15);

function moveCharacter(){
character.velocityY -= 5;
character.velocityX -= 0.2;
character.velocityX += 0.2;

function resetwatermelon(){
watermelon.x = randomNumber(0,400);
watermelon.y = randomNumber(0,400);

function gravity(){
character.velocityY += 0.2;


Could you post the link to the project here? It’s nice to be able to go in and just make it run to see what it’s doing. Thanks!



Jan 21, 23:37 PST

One of my stduents is not able to proceed with her project on AppLab. Everytime, she enters the code , the screen goes blank and nothing happens. I am sharing the link to her project below. Please help her out. Thanks

Sorry, I didn’t know where exactly to enter this post.



Hello Mindy!
The problem this student is experiencing is in the animation tab. It appears the student attempted to scale the giraffe and watermelon sprites down using the animation tools instead of adjusting the size in the code. This caused the collider (or hitbox) for both sprites to be the size they were before they were scaled down, which was very large, which caused the sprites to constantly collide.
An easy fix for this is to remove both sprites, and create new ones without scaling them down in the animation tab, and remember that the problem is not with the code.
Hope this solves your issue!
Thanks, have a great day! :slight_smile:


Hello Hatif! To answer your question, your app is starting on the blank screen “boy13”. To fix this you would have to set the starting screen to “Homescreen” or whichever starting screen is needed.
Hope this helps, have a great day! :smiley: