GithubHelp home page GithubHelp logo

codingtrain / oregon-trail Goto Github PK

View Code? Open in Web Editor NEW
26.0 9.0 10.0 417 KB

A p5.js version of the Apple ][ Oregon Trail Game

Home Page: https://ct-oregon-trail.netlify.app

HTML 5.26% JavaScript 94.50% CSS 0.24%
apple2 oregon-trail p5js

oregon-trail's Introduction

oregon-trail's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oregon-trail's Issues

Page layouts

I have looked at the first few pages (before Matt's General Store) and here are all the page configurations that are in use.

1. Image + Options

Screenshot from 2023-08-05 22-48-57

Breakdown of the elements:

  • Image element (The Oregon Trail image)
  • Separation image
  • Numbered options
  • Submit that takes numbers from 1 to the amount of options
  • Separation image

2. Text + Options

image

Breakdown of the elements:

  • Separation image
  • Some text
  • Numbered options
  • Submit that takes numbers from 1 to the amount of options
  • Separation image

3. Text + [Spacebar]

image

Breakdown of the elements:

  • Separation image
  • Some text
  • Separation image
  • Confirmation message (press SPACE BAR to continue)

4. Image + Question

image

Breakdown of the elements:

  • Image element
  • Question
  • Text input (Should have a limit of characters)

5. Image + Question + List inputs

image
image

Breakdown of the elements:

  • Image element
  • Question
  • Numbered list of inputs (Each should have a limit of characters)
  • Confirmation message (Enter names or press Return)
  • After inputing, confirmation message changes to a Yes/No confirmation question

6. Loading screen

image

Breakdown of the elements:

  • Image element
  • Some text in a bordered container for emphasis

7. Image + [Spacebar]

image

Breakdown of the elements:

  • Image element
  • Some text over the image in a bordered container for emphasis
  • Confirmation message (press SPACE BAR to continue)

8. Dialogue + [Spacebar]

image

Breakdown of the elements:

  • Some text
  • Image element on left
  • Bullet points on right
  • Confirmation message (press SPACE BAR to continue)

Conclusion

There are a lot of page layouts that are not even the core game. Currently adding pages is hard and not efficient. Maybe a simple page editor that would generate the JSON code will solve this issue.

Render "slide"

Maybe there is a better term, but taking the data from game_data.json and rendering the text and choices.

Found the game sprites

Don't know if any of you have discovered this already but I found what appears to be the full game sprites for Oregon Trail. Perhaps these could be a useful reference for any graphic artists working on this? [Edited] Looks like they're for the PC version though.
Link: https://spritedatabase.net/game/2151

Screen Grab idea for fastest proof of concept

Could there maybe be a collection of saved screenshots organized some way, perhaps in numerical order notation, that could be used to simply paint an image of that screen and grab keyboard input to "play" an alpha version of this? Perhaps maybe whoever is doing the new artwork could refer to it as well?

First issue

Are you going to do it in BASIC, or p5.js? First question!

Slides or Pages?

It seems like there should be only one in use.

So that code like this:

// From js/slide_manager.js lines 107-112
changePageTo(name) {
    const page = this.getSlideByName(name);
    if (page != undefined) {
        this.currentSlide = page;
    }
}

is less confusing:

changeSlideTo(name) {
    const slide = this.getSlideByName(name);
    if (slide != undefined) {
        this.currentSlide = slide;
    }
}

I can refactor it, but I need to know which one.

Game World Editor?

(Been working on my own take on this while checking back here).... After a few attempts to build the various rooms I noticed that, for me anyway as a longtime hobby programmer, it looks like it will be easier to simply build the game world editor program first and then later the game itself. That way it'll be easier (?) to view, manage and update the json files while getting a visual idea of how these screen/pages are going to look like. and all fit together.
So the big question here is, wouldn't it be a better idea to build the world editor first? Because right now I'm seeing a problem here right away, in that the json files here don't seem to logically connect with something like a room number and pointers to/from other room numbers and room class types. Plus back-connector data as well.
Just for as an example on this, a simple "hit spacebar to continue" screen should have "nextRoom" and "prevRoom" data in it, esp. helpful for later bug testing. and of managing and updating the game world itself. To clarify, I don't mean the next or previous element in the json file but the actual room paths back and forth, because those may be different and in a game editor it's going to make more visual sense to page through how the player's going to see these screens.

Automatic text wrapping

Right now for rendering a new line you must add a new element in the JSON string array.

@shiffman already suggested using the text() function where you can specify the width and height of the textbox.

More accurate font

The VT323 font is really accurate, but the letter width is way too small.
font-difference

Architecture of the game data json

Hi,
i would like to propose a structure for the game data json file, which is called "slide_data.json" in the repository.

At the JSON root you have a start and end name as Entry- and Exitpoint for the game. Then you have a object called Pages, which holds all the Data for a given Page. Each Page has a Name to reference it in other Pages (think of it as an ID) and a type. The type determines, which Class should Render the Page. e.g. a Page with the Type "shop" should be rendered by the shop class. Everything the class would need to do it's job, would then be in the data object for the page. So when instantiating the Class, you would give it the data Object and it would know how to deal with this data.

This approach would be totally data driven. The type Classes would be instantiated with the data, and some other Class, propably a game Manager of some sort, would get the Instance and would go from there. You propably would need more than one class per Type, for the different game Mechanics, e.g. one for Rendering, one for taking over the input and so on.

The JSON could look something like this

{
    "start": "startPage",
    "end": "ending",
    "pages": [{
        "name": "startPage",
        "type": "start",
        "data": {
            "title": "The Oregon Trail",
            "choices": [{
                "text": "Travel the trail",
                "action": "changePage",
                "newPageName": "travel",
            }, {
                "text": "Learn about the trail",
                "action": "changePage",
                "newPageName": "learn",
            }, {
                "text": "See the Oregon Top Ten",
                "action": "changePage",
                "newPageName": "topTen",
            }, {
                "text": "Turn sound off",
                "action": "toggleSound",
                "atlernativeText": "Turn sound on"
            }],
            "prompt": "What is your choice?",
            "img": "img/title.png",
        }
    }, {
        "type": "choice",
        "name": "travel",
        "data": {
            "text": "First text",
            "choices": [...],
            "img": "",
            "nextPage": "story1"
        }
    }, {
        "type": "story",
        "name": "story1",
        "data": {
            "texts": [
                "This is the first text",
                "This is the second text, which will appear after pressing space"
            ]
        }
    }, {
        "type": "shop",
        "name": "firstShop",
        "data": {
            "items": [{
                "id": 1,
                "name": "Some thing to buy",
                "description": "This is a buyable thing",
                "price": 1600
            }],
            "topText": "Here could be your shop text",
            "nextPage": "pageAfterShop"
        }
    }]
}

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.