CHANNELS:

All
b
b1u3ch1p posted 6 months ago
chris posted 6 months ago

Hi b1u3ch1p, you're off to the right start, your class creation, object instantiation, and rendering all seem correct. Your best bet in this case is to start commenting out the render code of other objects like your background, goombas, and platforms; up until you can be absolutely positive that your text is being drawn where you expect it to be.

If not showing still with a blank canvas, you'll want add some draw code directly within the object you're looping over like this:

texts.forEach((text) => {   
  text.update()
  c.fillText('my text here', 0,0)
})

That should show some text as long as texts is populated. With this you should be able to pinpoint your bug and see exactly what's preventing your text from rendering.

Also, I'll be adding some fixes to the forum's text editor so you can easily see what each of the text buttons does, hang tight for that!

1
b
b1u3ch1p posted 6 months ago

Thanks Chris!

I was tinkering around with it and found it easiest to add some logic where when Mario touches an object, pop the text on screen at visible x,y coordinates.

This worked and solved the problem to have the relevant story elements pop up for the player.

Thank you for all your help!

1

Want to participate?

Create a free Chris Courses account to begin

or
Sign In

Providing the lift to launch your development career

© 2023 Chris Courses. All rights reserved.