sei-ec-remote / project-1-issues

Open new issues here
1 stars 2 forks source link

Game project issue #220

Closed F2easy closed 9 months ago

F2easy commented 9 months ago

What's the problem you're trying to solve?

Having trouble linking my images/characters to a const so I can eventually move them throughout the squares once I get deeper into my game logic

Post any code you think might be relevant (one fenced block per file)

const p1 = document.getElementById('player1') ; 
const p2 = document.getElementById('player2') ;

If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?

no error message just the 2 images aren't being selected

What is your best guess as to the source of the problem?

the referencing of my images/characters

What things have you already tried to solve the problem?

googled around.

Paste a link [to] your repository here[

(https://github.com/F2easy/Project-1-Race-Me)]

timmshinbone commented 9 months ago

Share your HTML

F2easy commented 9 months ago

<!DOCTYPE html>

Race Me
Let's Race
“Tiger/player1”
“Gorilla/player2”
timmshinbone commented 9 months ago

Read this:

<div class="player1">

Then tell me why getElementById('player1') isn't working for that element

F2easy commented 9 months ago

should I be selecting by class instead ?

F2easy commented 9 months ago

Hey Timm, I tried changing what I was referencing from id to class, I also tried using document.querySelector. Still nothing I asked Albi for help and we couldn't figure it out.

F2easy commented 9 months ago

Cleaned up Divs had an unnecessary amount which led to selecting wrong classes and overall output of screen.