Skip to content

Commit

Permalink
version 8.12 (le-doux#265)
Browse files Browse the repository at this point in the history
* Add regenerate button for blips (le-doux#236)

* Regenerate blips without creating a new one
* Regenerating a blip does not modify its name

* Write Guide for lockedDoor.md (le-doux#257)

* Write Guide for lockedDoor.md

Write step by step guide with images explaining how to create a locked door

* Fix build crash for lockedDoor.md

The format for one of the images caused the build to crash. Attempt to fix it.

* Fix another build crash in lockedDoor.md

The crash seems to be related to the images placed side-by-side, but I'm not entirely sure. Hopefully this fixes it.

* Add new image in lockedDoor.md

I combined the two separate images, so hopefully npm doesn't get upset and crash this time.

* Remove image in lockedDoor.md

I'm not sure why the last image kept causing a crash. Removing it for now, and maybe someone can help me add it back later.

* Add image back to lockedDoor.md

npm crashed even without the image, so that was not the problem. Trying to rewrite the bottom of the file in case there was a hidden character causing the crash.

* Removing Step 5 in lockedDoor.md

Seeing if npm crashes without the last step written.

* Update lockedDoor.md

I'm not sure what's causing the npm crash. I'm just going to leave the file so it looks how I intended in the preview, and hopefully someone can help me fix the npm crash.

* Add closing tags to img in lockedDoor.md

* v8.12 updates

---------

Co-authored-by: Alex Nash <contact@alexnash.dev>
Co-authored-by: vaasut <vaasut1@gmail.com>
  • Loading branch information
3 people authored May 3, 2024
1 parent a47e6b0 commit f43e904
Show file tree
Hide file tree
Showing 24 changed files with 284 additions and 168 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 8.12

- docs: add locked door guide (@vaasut)
- docs: add tune tool documentation
- docs: add blip tool documentation
- feature: blip tool: add re-generate button (@nashalexander)
- feature: blip tool: tweaks to menu layout & tool name
- feature: room tool: grid & wall visibility settings are saved
- feature: dialog tool: "none" option for exit transitions from dialog
- fix: fixed memory leak when editing rooms with large numbers of unique tiles (such as those exported by pixsy)
- fix: game data text wasn't updating with edits from other tools
- fix: added missing docs link to game tool
- fix: copying drawings no longer loses animation frames
- fix: reset game doesn't break title text
- fix: game & dialog tools were opening at unexpected times

## 8.11

- game tool: combines the features of the download, settings, and game data tools into one tool
Expand Down
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- equa (@equaa) - Contributor
- @frojo - Contributor
- max - Contributor
- @nashalexander - Contributor
- @pancelor - Contributor
- Pirijuamps - Contributor
- @ragzouken - Contributor
Expand Down
4 changes: 2 additions & 2 deletions dev/resources/defaultGameData.bitsy
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Write your game's title here

# BITSY VERSION 8.0
# BITSY VERSION 8.12

! VER_MAJ 8
! VER_MIN 0
! VER_MIN 12
! ROOM_FORMAT 1
! DLG_COMPAT 0
! TXT_MODE 0
Expand Down
42 changes: 35 additions & 7 deletions docs/docs/faq/lockedDoor.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
---
tags: [stub]
---
# How to Make a Locked Door

# How to make a locked door
There are many different variations of a locked door. This guide will explain the basics.

:::info This page is a stub
You can improve the docs by [expanding it](../contributing).
:::
<img width="400" alt="demo_gif" src="https://github.com/le-doux/bitsy/assets/15849522/77eee9fa-bc19-4d2b-a8d9-0e8d9f5390b6"/>

(In this example, the door is not open to you unless you have a membership id card.)

## Step 1
To start, open the room view and place objects around as you like. In this example, the cat will function as our locked door. The membership id card is the key. Note that the card is an "item" and we have changed its name to "card".

<img width="400" alt="room_view" src="https://github.com/le-doux/bitsy/assets/15849522/585ca8e1-998a-46db-94bf-768a4826ae22"/>


## Step 2
Select exits & endings in the room view, and open the exits & endings tools if it's not already open (click the little arrow next to it). Create an exit, and place an entrance and exit before and after your locked door. You may also place these in different rooms depending on your game. Click the gear for the first exit to add logic for the locked door.

<img width="400" alt="exit_one" src="https://github.com/le-doux/bitsy/assets/15849522/9d2de816-fdb8-41b6-bc10-c146e80f2e22"/>


## Step 3
With the gear selected in the exits & endings tool, you can click "+ add lock". This will populate the dialogue editor with some simple logic for your locked door.

<img width="200" alt="exit_ending" src= "https://github.com/le-doux/bitsy/assets/15849522/41204217-9d91-48b2-9b48-5513c47e0908"/>


## Step 4
In the dialogue editor, you can write specific text and logic for when the player has the key and when they do not have the key. You can adjust the logic depending on the needs of your game. In this example, notice that we set the specific item to be "card" and the player must have at least one of them.

<img width="200" alt="dialogue_editor" src="https://github.com/le-doux/bitsy/assets/15849522/4770f100-334d-4196-a7a7-d6455765969a"/>
<img width="200" alt="dialogue_editor_two" src="https://github.com/le-doux/bitsy/assets/15849522/d8f54561-e968-448d-aff2-4845fcc131ac"/>

## Step 5
That's all you need to do for a simple locked door! However, you may want to adjust other variables or items after you open a locked door. For example, in Zelda games, you lose a key after you use it. To do this, you can select "item and variable actions" and add some logic for specific branches. For the Zelda key example, you may wish to decrement the item count.

<img width="200" alt="item_variable" src="https://github.com/le-doux/bitsy/assets/15849522/a4772cf6-c3ba-44ce-994a-64a614e679b2"/>
<img width="200" alt="item_variable_two" src="https://github.com/le-doux/bitsy/assets/15849522/6773b6fa-2f5d-4e32-9265-3e117f068b4d"/>
Binary file added docs/docs/tools/blip/.images/blipDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/docs/tools/blip/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Blip

## Description

The Blip tool lets you generate sound effects using several built-in generators and then tweak the results. These sound effects can be played when walking into [sprites](../paint/spritePaint), picking up [items](../paint/itemPaint), from [dialog](../dialog/soundActions), or as part of a [tune](../tune).

## Features

![blip diagram](.images/blipDiagram.png)

- **Navigation controls.** The top row of controls are the standard navigation and editing controls.
- **Blip name.** Name your blip to easily refer to it in other tools.
- **Previous / next blip.** Navigate sequentially through all the blips in the game.
- **Add new blip.** Add a new blip. This blip will be generated using the currently selected [blip-o-matic](#blip-o-matic) generator.
- **Duplicate blip.** Make a copy of the currently selected blip.
- **Delete blip.** Delete the currently selected blip. (Cannot be undone!)
- **Open blip in find tool.** Show blips in the find tool.
- **Blip visualiser.** Under the navigation controls is a visual representation of the blip based on how its frequency and volume changes over time. Click anywhere on the visualizer to play the blip with its current settings.
- **Playback and generator controls.**
- **Play blip.** Click the play button to replay the blip with its current settings.
- **Blip-o-matic.** Use the blip-o-matic dropdown to select the type of sound generator to use (see [blip-o-matic](#blip-o-matic) for a list).
- **Regenerate blip.** Click the button next to the blip-o-matic dropdown to re-generate the current blip using the selected generator.
- **Adjust blip pitch.** Increase or decrease the frequency of the notes used in the blip.
- **Adjust blip duration.** Increase or decrease the total length of the blip.
- **Adjust blip speed.** Increase or decrease how quickly the blip cycles through notes.

## Blip-o-matic

Use the blip-o-matic dropdown to select different sound generators. The generators have names to indicate the types of things the sounds *could* be used for, but they can be used in many other ways as well. If the generators aren't quite making what you want, try using the pitch, duration, and speed controls to tweak the results. Experiment and have fun!

Here are the generators and their descriptions:
- **Pick up.** Sounds an item might make when you pick it up.
- **Greeting.** Sounds a sprite could say hello with.
- **Bloop.** Lower pitched, rounder sounds.
- **Bleep.** Higher pitched, tinnier sounds.
- **Magic.** Weird sounds.
- **Meow.** "I'm a cat."
- **Random.** Who knows???
- **Mutate.** Make a new blip from the selected one, with random tweaks.
Binary file not shown.
41 changes: 0 additions & 41 deletions docs/docs/tools/blipomatic/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/docs/tools/paint/itemPaint.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

10. **Item animation**. Opens the animation panel where you can edit two animation frames. Select frame 1 or frame 2 to edit it in the paint window. The preview shows how the animation will look when playing the game.

11. **Sound effect button**. Choose a [blip sound effect](../blipomatic) that will play when the player walks into this item. Choose none if you do not want a sound effect.
11. **Sound effect button**. Choose a [blip sound effect](../blip) that will play when the player walks into this item. Choose none if you do not want a sound effect.

12. **Open inventory**. Opens the [inventory tool](/tools/inventory/).

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tools/paint/spritePaint.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

10. **Sprite animation**. Opens the animation panel where you can edit two animation frames. Select frame 1 or frame 2 to edit it in the paint window. The preview shows how the animation will look when playing the game.

11. **Sound effect button**. Choose a [blip sound effect](../blipomatic) that will play when the player walks into this sprite. Choose none if you do not want a sound effect.
11. **Sound effect button**. Choose a [blip sound effect](../blip) that will play when the player walks into this sprite. Choose none if you do not want a sound effect.

12. **Dialog selection toggle**. Click this button to show a dropdown menu of all the dialogs you have created. Clicking it again will allow you to edit the current dialog.

Expand Down
88 changes: 51 additions & 37 deletions docs/docs/tools/tune/index.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,99 @@
---
tags: [stub]
---

# Tune

:::info This page is a stub
You can improve the docs by [expanding it](../../contributing).
:::

## Description

The tune tool is where you compose music for your game. Tunes created with this tool can be set as looping background music for a [room](../room), or played from [dialog](../dialog/soundActions).

## Features

### Main panel

![tune diagram](.images/tuneDiagram.JPG)

1. **Tune name.**
1. **Tune name.** The name of the currently selected tune.

2. **Previous / next tune.**
2. **Previous / next tune.** Navigate through all the tunes in your game.

3. **Add new tune.**
3. **Add new tune.** Create a new tune.

4. **Duplicate tune.**
4. **Duplicate tune.** Make a copy of the current tune.

5. **Delete tune.**
5. **Delete tune.** Delete the current tune.

6. **Open tune in find tool.**
6. **Open tune in find tool.** Show all tunes in the find tool.

7. **Bar selector (melody and harmony).**
7. **Bar selector (melody and harmony).** Select the current bar (or measure) of music to edit in the piano roll. The top row of bars is the melody, the bottom row is the harmony.

8. **Piano roll.**
8. **Piano roll.** The piano roll is where you input notes for your tune. Click on an empty space to add a note, or click and drag to add longer notes. Click on a note to erase it.
- **Strum mode (Arpeggiated harmony).** When arpeggiation is enabled for the harmony, instead of entering each note individually the piano roll is used to select the initial note of a scale that will be played according to the selected harmony strum pattern (see [Compose Menu](#compose-menu) for details).

9. **Note octave.**
9. **Note octave.** Click the octave icon below the start of a note to cycle through octaves. There are four octaves available.

10. **Play.**
10. **Play.** Play the current tune. (Becomes a stop button while playing.)

11. **Toggle loop on / off.**
11. **Toggle loop on / off.** When enabled the current bar will loop instead of continuing on to the rest of the tune. Helpful when making adjustments to a single bar.

12. **Bar indicator.**
12. **Bar indicator.** The numbers indicate which bar is selected. The icon to the left of the numbers indicates whether the melody (trumpet icon) or harmony (tuba icon) is visible in the piano roll.

13. **Move selected bar left / right.**
13. **Move selected bar left / right.** Re-order the currently selected bar within the tune.

14. **Add new bar.**
14. **Add new bar.** Add a new empty bar. You can have up to 16 per tune.

15. **Duplicate selected bar.**
15. **Duplicate selected bar.** Make a copy of the current bar and add it to the end of the tune.

16. **Delete selected bar.**
16. **Delete selected bar.** Delete the current bar.


### Compose settings
### Compose Menu

![compose settings diagram](.images/tuneComposeDiagram.JPG)

1. **Compose button.**
1. **Compose button.** Select to show the compose tools.

2. **Note entry tool.**
2. **Note entry tool.** Choose the type of note to use when entering notes in the piano roll.
- **Note.** Musical notes.
- **Blip.** Sound effects created using the [blip tool](../blip).

3. **Harmony strum pattern (arpreggios).**
3. **Harmony strum pattern (arpreggios).** Choose what arpeggio pattern to use for the harmony. (Only enabled when a harmony bar is selected.)
- **Strum off.** Disable arpeggio mode to input harmony notes manually.
- **Strum chord (up).** Arpeggiate a four note chord, moving up the scale.
- **Strum chord (down).** Arpeggiate a four note chord, moving down the scale.
- **Strum interval (small).** Arpeggiate a two note alternating interval.
- **Strum interval (big).** Arpeggiate a two note alternating interval, a full octave apart.


### Instrument settings
### Instrument Menu

![instrument settings diagram](.images/tuneInstrumentDiagram.JPG)

1. **Instrument button.**
1. **Instrument button.** Select to show the instrument tools.

2. **Melody instrument tone.**
2. **Melody instrument tone.** Select the tone to use for notes in the melody.
- **Tone P2.** A pulse wave with a duty of 1/2, aka a square wave.
- **Tone P4.** A pulse wave with a duty of 1/4.
- **Tone P8.** A pulse wave with a duty of 1/8.

3. **Harmony instrument tone.**
3. **Harmony instrument tone.** Select the tone to use for notes in the harmony.


### Style settings
### Style Menu

![style settings diagram](.images/tuneStyleDiagram.JPG)

1. **Style button.**
1. **Style button.** Select to show the musical style tools.

2. **Tune speed (tempo).**
2. **Tune speed (tempo).** Choose how fast the tune should play.
- **Slow.** 60 bpm (adagio).
- **Medium.** 80 bpm (andante).
- **Fast.** 120 bpm (moderato).
- **Turbo.** 160 bpm (allegro).

3. **Tune mood.**
3. **Tune mood.** Swap between cheery (major key) and gloomy (minor key) moods. When using this setting, notes will automatically be transposed to the equivalent note in the new key. (Not available in chromatic mode - see below.)
- Tip: Try making a copy of a tune and swapping its mood to see how it sounds!

4. **Key.**
4. **Key.** Advanced musical key options. Controls which notes are available to use in the piano roll.
- **Major.** Restricts notes to the C major pentatonic scale. This is a basic key that's easy to work with.
- **Minor.** Restricts notes to the C minor pentatonic scale. This is a basic key that's easy to work with.
- **Full major.** Restricts notes to the C major diatonic scale. An intermediate key that provides more flexibility than the basic keys.
- **Full minor.** Restricts notes to the C minor diatonic scale. An intermediate key that provides more flexibility than the basic keys.
- **Chromatic.** Enables the full 12-note musical scale. Advanced. (Note: When chromatic mode is enabled, arpeggiated harmony features are disabled.)
2 changes: 1 addition & 1 deletion editor/script/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function makeToolCard(processName, initFunction) {
if (card.worldData) {
// is just attaching to the card object ok??
card.world = parseWorld(Resources[card.worldData]);
card.renderer = new TileRenderer(tilesize);
card.renderer = new TileRenderer(card.id);
card.renderer.SetDrawings(card.world.drawings);
}

Expand Down
25 changes: 22 additions & 3 deletions editor/script/dialog_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2680,7 +2680,14 @@ function DialogTool() {

function createSetArgFunc(functionNode, parameterIndex, parentEditor) {
return function(argNode) {
functionNode.args.splice(parameterIndex, 1, argNode);
if (argNode != null) {
functionNode.args.splice(parameterIndex, 1, argNode);
}
else {
// null parameter node = delete this argument!
functionNode.args.splice(parameterIndex, 1);
}

parentEditor.NotifyUpdate();
};
}
Expand Down Expand Up @@ -2938,6 +2945,12 @@ function DialogTool() {
GetName: function() { return localization.GetStringOrFallback("transition_slide_r", "slide right"); },
id: "slide_r",
},
{
// todo : localize
GetName: function() { return "none"; },
// todo : hack! empty string is not actually a valid transition ID - just used to indicate this parameter should be deleted
id: "",
}
];

function ParameterEditor(parameterTypes, getArgFunc, setArgFunc, isEditable, isTypeEditable, openExpressionBuilderFunc) {
Expand Down Expand Up @@ -3203,8 +3216,14 @@ function DialogTool() {

parameterInput.onchange = function(event) {
var val = event.target.value;
var argNode = scriptUtils.CreateStringLiteralNode(val);
onChange(argNode);
if (val.length <= 0) {
// empty transition ID = delete the parameter!
onChange(null);
}
else {
var argNode = scriptUtils.CreateStringLiteralNode(val);
onChange(argNode);
}
}
}
else if (type === "tune") {
Expand Down
Loading

0 comments on commit f43e904

Please sign in to comment.