CHANNELS:

All
j
Pokemon Style Game NPC Conversations
Canvas
jonellwood posted 3 years ago

Okay I am stumped on how to accomplish this. As I wait for the next video to come out I have attempted this on my own about 20 different ways.

I have made several things "work" to include using the userInterface div and appending newly created div's to it after removing and / hiding all the ones already in there. Which works until you battle after a conversation.

I made conversation collisions layers to trigger conversation events which works... in fact it works every time you collide.. so it basically just creates a loop since you are in the collision area at the end of the conversation ....

I have tried make an array of coordinates and creating divs on the fly if the clientX is in the area. Very manual process but it works...as long as you don't move around the map..... lol

Any have any pointers or ideas? I have another week off work and have been obsessed with this project. I admit I have learned A TON so far - but I can not seem to get a game plan together. Since the Sprites are not DOM objects it is hard to reference them to create a clickEvent. Unless there is some magic isClickable property we can add to the class or something ....🤔

Not looking for the answer honestly - just pointing in the right direction would be great! I am loving figuring it out but I am stuck.

https://jonellwood.dev/ is the current state of what I have so far.

j
jonellwood posted 3 years ago

Updated: I think I have figured it out for the most part. Crated an NPC class that extends the Sprite class. Created an array of phrases - and did basically the same thing we did on the battle scene. Created buttons, grabbed the innerHTML of the buttons to populate the sentence text in a div down below. Still buggy because the buttons render twice for some reason sometimes - but not always...

(Updated: I forgot to replaceChildren() on function call. That cleared this issue up).

1
chris posted 3 years ago

I should have an exact tutorial / source code for this feature within the next two weeks. Finishing up editing on Tower Defense, then want to spend the next month on just Pokemon premium. Code is there for this, just have to record and edit it 😅

4

Want to participate?

Create a free Chris Courses account to begin

or
Sign In

Providing the lift to launch your development career

© 2025 Chris Courses. All rights reserved.