Almost good, but one problem


OK, so here is main problem I have... I am almost done with my gamebook project (after a very, very long delay). I decided to go on a 100%, simple text based game just to practice it. I realize this will be the only javascript project I will do for now since I've taken too many months on this and need to finish the Jquery project. To think I started all this back in June! It makes me wonder just where the time went.

That being said, I took inspiration from CCmultimedia's game Der Kerker for the format, since I really didn't know where to start with the whole thing, especially with javascript. I have to admit, I learned a lot making this... now onto my problem.

So the game... works. The commands work, the messages pop up just fine, it responds the way I want it to respond (with one exception). But here's the kicker... the HTML displays ALL the area messages at the start of the game when it is loaded. It does unfold as it should during the course of the game, but it just won't not show it at the start. I looked at Der Kerker, and I'm not sure what he did. I looked at the code and the CSS and I found nothing. I will give my HTML, CSS, and both Javascript codes below



i add in your css a "display: none" for all div that should not be shown at the start

And on your room.js on line 202

$("<p>You spin around in a circle </p>").insertBefore().fadeIn(1000);

I added #placeholder

You should see the corrected files at jsfiddle now.


YES! Thank you! I added

div p {
display: none;

And this fixed my problem. :slight_smile: I love how stupid simple the solutions can be.

There are still some problems. When I win the game now, it displays a blank screen, and when I hit the first terrorist, it gives me the message that he has already been hit... and now when I win the game, it is a blank screen and doesn't have the win message anymore... Not sure what is happening.

I will update my JSfiddle with the new code.