Giter Site home page Giter Site logo

castleadventure's People

Contributors

jlr7245 avatar

Watchers

 avatar  avatar

castleadventure's Issues

Two rooms

  • The game should have at least two "rooms"
  • Rooms will be objects rendered onto the page based on coordinates hard-coded into the object
  • Which rooms render on the page is dependent on user interaction. The first room that renders will always be the same room but afterwards the user will choose which room will render.

12/15 Problems with switching between Room class instances

I am having trouble getting my room switcher working correctly. There are two separate issues:

  • The player location from the previous room is still displaying
  • It's impossible to return to a room -- says the walls are not defined.

I asked about the first on StackOverflow here and talked to Stefan about it as well. The answer worked on StackOverflow to a degree -- initially the extra player was moving together with the player in the correct position -- but it still seems I can't clear the position from the previous room.

I feel the second issue is happening probably for the same reason as the first - Room class objects aren't being cleared properly so it's reading them twice. One should be able to leave a room and then immediately return to it. Instead, the following things happen:

  • The board is cleared through new instance of CanvasState class
  • The Room doesn't change to a new Room -- stays the same as the previous one -- but the walls are no longer there, leaving the player in the void. (Currently there are only 3 rooms - courtyard, entry hall, and welcome hall - so if you keep going north after the entry hall you end up in the void anyway.)

This is an issue with classes, so documentation is hard to find and I'm having a rough time puzzling through ES5 documentation and trying to apply it to my situation.

Desired outcome would be the Room class recognizing the array of wall shapes it's been passed. EDIT Turns out the function doesn't recognize any connecting rooms after the first one in the array - says they're undefined.

See behavior replicated here.
Applicable code is here

I will continue to try to work through this but any help would be appreciated! ๐Ÿ™ Thanks so much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.