JirkaDellOro / Prima

Repository for the module "Prototyping interactive media-applications and games" at Furtwangen University
https://jirkadelloro.github.io/Prima
10 stars 17 forks source link

Sprites are not shown #69

Open Niclas-Cravaack opened 1 year ago

Niclas-Cravaack commented 1 year ago

I have the problem that my sprites are not displayed. I have no idea why that is, does anyone have an idea? here is the link to my project https://niclas-cravaack.github.io/PRIMA/SpaceFighters/index.html I hope someone can help.

JirkaDellOro commented 1 year ago

Poste auch den Link zu deinem Code

Niclas-Cravaack commented 1 year ago

https://github.com/Niclas-Cravaack/PRIMA/tree/main/SpaceFighters/Script/Source

JirkaDellOro commented 1 year ago

Also ich kriege prompt die Meldung

Main.ts:35 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'spriteSheedPath')
    at HTMLDocument.start (Main.ts:35:43)
    at startInteractiveViewport (Autoview.js:73:10)

Der Astronaut in Zeile 35 wird wohl nicht definiert, wo oder wann sollte das geschehen?

Niclas-Cravaack commented 1 year ago

der wird eigentlich in Zeile 39 definiert in 35 wird ja nur die Textur für den astronauten geladen. Ich versteh nicht was ich da ändern müsste

Niclas-Cravaack commented 1 year ago

Also in Zeile 35 steht im Code nichts ich hab jetzt auf mehreren Wegen versucht die Sprites aufzurufen und den Astronaut zu initialisieren. Ich versteh nicht wo das Problem damit liegt

JirkaDellOro commented 1 year ago

Das lese ich ab Zeile 35

    await astronautTexture.load(astronaut.spriteSheedPath);
    //creating and setting up the Astronaut
    astronaut = new Astronaut(astronautTexture);

Du greifst also auf die Eigenschaft spriteSheedPath (was wahrscheinlich spriteSheetPath heißen soll) des Austronatuen zu, den Du erst zwei Zeilen später erzeugst.