-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,10 @@ | |
<script type="text/bitsyGameData" id="exportedGameData"> | ||
Write your game's title here | ||
|
||
# BITSY VERSION 8.4 | ||
# BITSY VERSION 8.6 | ||
|
||
! VER_MAJ 8 | ||
! VER_MIN 4 | ||
! VER_MIN 6 | ||
! ROOM_FORMAT 1 | ||
! DLG_COMPAT 0 | ||
! TXT_MODE 0 | ||
|
@@ -1548,7 +1548,7 @@ | |
// is this the right place for this to live? | ||
var version = { | ||
major: 8, // major changes | ||
minor: 4, // smaller changes | ||
minor: 6, // smaller changes | ||
devBuildPhase: "RELEASE", | ||
}; | ||
function getEngineVersion() { | ||
|
@@ -1965,6 +1965,28 @@ | |
}; | ||
} | ||
|
||
function createExitData(x, y, destRoom, destX, destY, transition, dlg) { | ||
return { | ||
x: x, | ||
y: x, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
seleb
Author
Owner
|
||
dest: { | ||
room: destRoom, | ||
x: destX, | ||
y: destY | ||
}, | ||
transition_effect: transition, | ||
dlg: dlg, | ||
}; | ||
} | ||
|
||
function createEndingData(id, x, y) { | ||
return { | ||
id: id, | ||
x: x, | ||
y: y | ||
}; | ||
} | ||
|
||
function parseRoom(parseState, world) { | ||
var i = parseState.index; | ||
var lines = parseState.lines; | ||
|
@@ -2056,17 +2078,14 @@ | |
var exitCoords = exitArgs[1].split(","); | ||
var destName = exitArgs[2]; | ||
var destCoords = exitArgs[3].split(","); | ||
var ext = { | ||
x : parseInt(exitCoords[0]), | ||
y : parseInt(exitCoords[1]), | ||
dest : { | ||
room : destName, | ||
x : parseInt(destCoords[0]), | ||
y : parseInt(destCoords[1]) | ||
}, | ||
transition_effect : null, | ||
dlg: null, | ||
}; | ||
var ext = createExitData( | ||
/* x */ parseInt(exitCoords[0]), | ||
/* y */ parseInt(exitCoords[1]), | ||
/* destRoom */ destName, | ||
/* destX */ parseInt(destCoords[0]), | ||
/* destY */ parseInt(destCoords[1]), | ||
/* transition */ null, | ||
/* dlg */ null); | ||
|
||
// optional arguments | ||
var exitArgIndex = 4; | ||
|
@@ -2091,11 +2110,10 @@ | |
var endId = getId(lines[i]); | ||
|
||
var endCoords = getCoord(lines[i], 2); | ||
var end = { | ||
id : endId, | ||
x : parseInt(endCoords[0]), | ||
y : parseInt(endCoords[1]) | ||
}; | ||
var end = createEndingData( | ||
/* id */ endId, | ||
/* x */ parseInt(endCoords[0]), | ||
/* y */ parseInt(endCoords[1])); | ||
|
||
roomData.endings.push(end); | ||
} | ||
|
@@ -7230,7 +7248,7 @@ | |
|
||
// TODO : convert this into something that takes DialogChar arrays | ||
this.AddText = function(textStr) { | ||
bitsy.log("ADD TEXT " + textStr); | ||
bitsy.log("ADD TEXT >>" + textStr + "<<"); | ||
|
||
//process dialog so it's easier to display | ||
var words = textStr.split(" "); | ||
|
@@ -7338,20 +7356,25 @@ | |
var curRowArr = buffer[curPageIndex][curRowIndex]; | ||
|
||
// need to actually create a whole new page if following another pagebreak character | ||
if (this.CurChar() && this.CurChar().isPageBreak) { | ||
if (afterManualPagebreak) { | ||
this.FlipPage(); // hacky | ||
|
||
buffer[curPageIndex][curRowIndex] = curRowArr; | ||
buffer.push([]); | ||
curPageIndex++; | ||
buffer[curPageIndex].push([]); | ||
curRowIndex = 0; | ||
curRowArr = buffer[curPageIndex][curRowIndex]; | ||
|
||
afterManualPagebreak = false; | ||
} | ||
|
||
var pagebreakChar = new DialogPageBreakChar(); | ||
pagebreakChar.SetContinueHandler(onReturnHandler); | ||
|
||
curRowArr.push(pagebreakChar); | ||
|
||
isActive = true; | ||
isActive = true; | ||
} | ||
|
||
this.hasTextEffect = function(name) { | ||
|
@@ -7839,6 +7862,8 @@ | |
state.ava = playerId; // avatar appearance override | ||
state.pal = "0"; // current palette id | ||
state.tune = "0"; // current tune id ("0" === off) | ||
state.exits = []; // exits in current room | ||
state.endings = []; // endings in current room | ||
} | ||
|
||
// title helper functions | ||
|
@@ -8551,13 +8576,31 @@ | |
} | ||
|
||
// init exit properties | ||
state.exits = []; | ||
for (var i = 0; i < room[roomId].exits.length; i++) { | ||
room[roomId].exits[i].property = { locked:false }; | ||
var exit = createExitData( | ||
/* x */ room[roomId].exits[i].x, | ||
/* y */ room[roomId].exits[i].y, | ||
/* destRoom */ room[roomId].exits[i].dest.room, | ||
/* destX */ room[roomId].exits[i].dest.x, | ||
/* destY */ room[roomId].exits[i].dest.y, | ||
/* transition */ room[roomId].exits[i].transition_effect, | ||
/* dlg */ room[roomId].exits[i].dlg); | ||
exit.property = { locked: false }; | ||
|
||
state.exits.push(exit); | ||
} | ||
|
||
// init ending properties | ||
state.endings = []; | ||
for (var i = 0; i < room[roomId].endings.length; i++) { | ||
room[roomId].endings[i].property = { locked:false }; | ||
var end = createEndingData( | ||
/* id */ room[roomId].endings[i].id, | ||
/* x */ room[roomId].endings[i].x, | ||
/* y */ room[roomId].endings[i].y); | ||
end.property = { locked: false }; | ||
|
||
state.endings.push(end); | ||
} | ||
|
||
if (soundPlayer) { | ||
|
@@ -8652,19 +8695,20 @@ | |
return null; | ||
} | ||
|
||
function getExit(roomId,x,y) { | ||
for (i in room[roomId].exits) { | ||
var e = room[roomId].exits[i]; | ||
// todo : roomId isn't useful in these functions anymore! safe to remove? | ||
function getExit(roomId, x, y) { | ||
for (i in state.exits) { | ||
var e = state.exits[i]; | ||
if (x == e.x && y == e.y) { | ||
return e; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
function getEnding(roomId,x,y) { | ||
for (i in room[roomId].endings) { | ||
var e = room[roomId].endings[i]; | ||
function getEnding(roomId, x, y) { | ||
for (i in state.endings) { | ||
var e = state.endings[i]; | ||
if (x == e.x && y == e.y) { | ||
return e; | ||
} | ||
|
1 comment
on commit e1ed1f7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yaaaay
Wrong line here! Expected y: y