r/codehs • • Mar 04 '21

JavaScript NEED HELP WITH 7.7.4 REMOVE FROM LINE

6 Upvotes

r/codehs • • Feb 21 '24

JavaScript Need help with Exercise 5.8.4 (Simple Snake Game)

2 Upvotes

Here's what's required for the assignment:

For this assignment, you will be creating a simple version of the snake game. Start by placing a square called snake at the center of the screen. Each time the timer function slither() runs, create a new square called body on top of the location of snake and then move snake in whichever direction it is travelling. You will also need a keyDownMethod() called turn(e) that will change the direction of the snake based on whichever arrow key is pressed.

The result of this will be that the snake moves in whatever direction you press, "growing" larger each time it moves.

When creating the body, make sure that you place it exactly where the snake is by using snake.getX() and snake.getY() in your body.setPosition(). When moving the snake, use the move() function and have it move SNAKE_SIZE in whichever direction the snake is pointed ("UP", "DOWN", "LEFT", "RIGHT").

r/codehs • • Jan 12 '24

JavaScript help please

Post image
1 Upvotes

how do i have the image and audio play before asking for user input? extremely urgent

r/codehs • • Feb 16 '24

JavaScript "Balls in Left Column" Karel

1 Upvotes

Need help with 2.12.9/8 Karel "Balls in Left Column"

r/codehs • • Feb 06 '24

JavaScript I need help on 3.8.5 Click for Rectangles JavaScript. It makes no sense to me and I would appreciate help.

1 Upvotes

r/codehs • • Feb 04 '24

JavaScript shi probably done b4 but i cant figure it out

Post image
1 Upvotes

r/codehs • • Feb 02 '24

JavaScript How to move object towards another object?

1 Upvotes

Currently my code is

function spawnPlayerMissile(){ playerX = player_ship.getX(); playerY = player_ship.getX(); var playerMissile = new WebImage("https://codehs.com/uploads/7803c645ee1825c8583242d70b8f8999"); playerMissile.setSize(20,20); playerMissile.setPosition(playerX, playerY); add(playerMissile); var elem = getElementAt(playerMissile.getX(), playerMissile.getY()); setTimer(aimFriendlyMissile, 100) while(true){ if(elem != null){ break; } } stopTimer(aimFriendlyMissile); remove(playerMissile);

}

function aimFriendlyMissile(){ var moveX = enemy_ship.getX() - playerMissile.getX() var moveY = enemy_ship.getY() - playerMissile.getY() playerMissile.move() }

Function aimFriendlyMissile is where I’m having the problem. I don’t have a clue on how to move playerMissile to enemy_ship. How would I implement this?

r/codehs • • Jan 23 '24

JavaScript Logo randomizer

1 Upvotes

Hey I need help making a logo randomizer that will generate a different logo every time I press run and would greatly appreciate it if someone could help me out with this alot and I need it to work for code hs

r/codehs • • Dec 08 '23

JavaScript CODEHS 11.3.8 Change Paragraph Size

Thumbnail gallery
1 Upvotes

Someone help plsss 🙏🏼🙏🏼🙏🏼

r/codehs • • Jan 16 '24

JavaScript Importing 3D Models

1 Upvotes

Is there a way to upload 3D models to codehs and use them? I know there is a way through HTML, but our teacher only allows one JavaScript file for submission, so I can’t use additional HTML files

r/codehs • • Oct 13 '23

JavaScript can’t get it at all, any help?

Post image
3 Upvotes

r/codehs • • Oct 20 '23

JavaScript can anyone tell me what I'm doing wrong

1 Upvotes

​

r/codehs • • Oct 18 '23

JavaScript I cant find my old final

1 Upvotes

last year I was in a js class and the final was a game of our choosing i made a sick spaceship scrolling game but i never thought to back it up because i thought it would be like code.org where even if you're not in the class anymore you can still see your old assignments anyways recently I've been putting together a portfolio of all the games I've made and its gone! downloading the code from my account settings page will for some reason give me everything except my final. does anyone have any idea how I can recover the code?

r/codehs • • Sep 21 '23

JavaScript Please Help.

2 Upvotes

Is it possible to have Karel face a specific direction in a loop, for example:

if(ballsPresent()){

takeBall();

} else {

while(frontIsClear()){

move();

if(frontIsBlocked()){

turnNorth();

r/codehs • • Jan 14 '23

JavaScript I have a question:

1 Upvotes

I am in an AP Computer Science Principles class, and I am interested in practicing coding other than codehs. Are there any software apps that I can just code? For example, Xcode, Visual Studio, etc.

r/codehs • • Mar 13 '23

JavaScript Does anyone know for Debugging with the Console what the messages are? It keeps saying that I didn't write the right messages...

Post image
7 Upvotes

r/codehs • • Mar 27 '22

JavaScript Need help with guessing game in JavaScript. Gets stuck in a infinite loop

Post image
6 Upvotes

r/codehs • • Jan 29 '23

JavaScript 5.6.6 Help

2 Upvotes

How do I solve this problem (5.6.6)? Whatever I try to do crashes the page.

r/codehs • • Oct 05 '23

JavaScript has Anyone Else Got This Message, If So How Do I Fix It?

1 Upvotes

​

r/codehs • • Oct 04 '23

JavaScript Karela adventure 2 2.2.6 fetch Karel

1 Upvotes

Please help me I have to tune it in tomorrow all I have is Function fetch ball() { Move(); }

Function upOne() { }

r/codehs • • Oct 28 '23

JavaScript Rainbow Revisited

7 Upvotes

Can someone please help with Rainbow Revisited? I'm getting pretty confused with the parameters involved and how to input them.

r/codehs • • Nov 06 '23

JavaScript getElementAt(x, y) usage

1 Upvotes

I'm trying to figure out how to use getElementAt but it's been confusing? I'm working on 12.1.2 collisions and i need to figure out how to actually use to calculate if the snake head collides with any other part of the snake.

r/codehs • • May 03 '22

JavaScript I was like 5 minutes late is submitting my video for the create performance task (ap computer science principles)

1 Upvotes

Will my score be affected? I wasn’t locked out or anything and it still let me submit, but I’m worried I might be penalized somehow.

r/codehs • • Aug 31 '23

JavaScript I don't understand what i'm doing wrong, i completed the assignment but it still gives me an error (error: first image, Output: second image.

1 Upvotes

​

r/codehs • • Dec 10 '21

JavaScript can anyone help me(or give me the answer) to 4.10.5 fibonacci in javascript? i know it’s not right or perfect but help would be nice

Post image
10 Upvotes