Skip to content

Commit

Permalink
Created downtown map (#173)
Browse files Browse the repository at this point in the history
Part of #7
  • Loading branch information
r4pt0s authored Oct 23, 2024
2 parents 34a42f3 + aceec06 commit 2e2970a
Show file tree
Hide file tree
Showing 14 changed files with 2,916 additions and 7 deletions.
Binary file added public/exports/maps/map_downtown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,820 changes: 2,820 additions & 0 deletions public/maps/map_downtown.json

Large diffs are not rendered by default.

41 changes: 38 additions & 3 deletions public/maps/map_seaside.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@
"width":64,
"x":80,
"y":0
},
{
"height":0,
"id":234,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":480,
"y":208
}],
"opacity":1,
"properties":[
Expand All @@ -197,7 +208,7 @@
"value":false
}],
"type":"objectgroup",
"visible":false,
"visible":true,
"x":0,
"y":0
},
Expand Down Expand Up @@ -631,6 +642,30 @@
"width":0,
"x":448,
"y":208
},
{
"height":0,
"id":235,
"name":"spawn_city",
"point":true,
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":432,
"y":208
},
{
"height":0,
"id":236,
"name":"spawn_downtown",
"point":true,
"rotation":0,
"type":"",
"visible":true,
"width":0,
"x":112,
"y":32
}],
"opacity":1,
"properties":[
Expand All @@ -640,12 +675,12 @@
"value":false
}],
"type":"objectgroup",
"visible":false,
"visible":true,
"x":0,
"y":0
}],
"nextlayerid":27,
"nextobjectid":234,
"nextobjectid":237,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.0",
Expand Down
3 changes: 3 additions & 0 deletions src/gameObjects/map_downtown/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const gameObjects = [];

export default gameObjects;
3 changes: 3 additions & 0 deletions src/gameObjects/map_seaside/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const gameObjects = [];

export default gameObjects;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const enterMapSeasideInteraction = (player, k) => {
player.onCollide('enter_map_seaside', () => {
k.go('seaside', 'spawn_downtown');
});
};
5 changes: 5 additions & 0 deletions src/interactions/map_downtown/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { enterMapSeasideInteraction } from './enterMapSeasideInteraction.interactions';

const interactions = [enterMapSeasideInteraction];

export default interactions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const enterMapDowntownInteraction = (player, k) => {
player.onCollide('enter_map_downtown', () => {
k.go('downtown');
});
};
3 changes: 2 additions & 1 deletion src/interactions/map_seaside/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { enterMapCityInteraction } from './enterMapCityInteraction.interactions';
import { enterMapDowntownInteraction } from './enterMapDowntownInteraction.interactions';

const interactions = [enterMapCityInteraction];
const interactions = [enterMapCityInteraction, enterMapDowntownInteraction];

export default interactions;
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { gameStartScreen } from './scenes/gameMachine/startSceen';
import { loseScreen } from './scenes/gameMachine/lose';
import { classroom } from './scenes/classroom';
import { seaside } from './scenes/seaside';
import { downtown } from './scenes/downtown';

k.scene('start', (enter_tag) => bootstrap(start, { enter_tag }));
k.scene('city', (enter_tag) => bootstrap(city, { enter_tag }));
Expand All @@ -30,6 +31,7 @@ k.scene('campus_house_1', (enter_tag) =>
);
k.scene('classroom', (enter_tag) => bootstrap(classroom, { enter_tag }));
k.scene('seaside', (enter_tag) => bootstrap(seaside, { enter_tag }));
k.scene('downtown', (enter_tag) => bootstrap(downtown, { enter_tag }));
k.scene('fishing', (enter_tag) => miniGameBootstrap(fishing, { enter_tag }));

// Game Machine Scenes
Expand Down
24 changes: 24 additions & 0 deletions src/scenes/downtown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import gameObjects from '../gameObjects/map_downtown';
import { initMap } from '../init/map.init';
import interactions from '../interactions/map_downtown';
import sounds from '../sounds/map_downtown';

export async function downtown() {
const objectConfig = {
static: [
'map_boundaries',
'building_boundaries',
'enter_new_map_boundaries',
// 'objects',
],
spawnpoints: ['spawnpoints'],
interactionObjects: ['interaction_objects'],
};
const [map, spawnpoint] = await initMap(
objectConfig,
'./exports/maps/map_downtown.png',
'./maps/map_downtown.json'
);

return [map, spawnpoint, gameObjects, interactions, sounds];
}
6 changes: 3 additions & 3 deletions src/scenes/seaside.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// import gameObjects from '../gameObjects/map_forest';
import gameObjects from '../gameObjects/map_seaside';
import { initMap } from '../init/map.init';
import interactions from '../interactions/map_seaside';
// import sounds from '../sounds/map_forest';
import sounds from '../sounds/map_seaside';

export async function seaside() {
const objectConfig = {
Expand All @@ -19,5 +19,5 @@ export async function seaside() {
'./maps/map_seaside.json'
);

return [map, spawnpoint, [], interactions, []];
return [map, spawnpoint, gameObjects, interactions, sounds];
}
3 changes: 3 additions & 0 deletions src/sounds/map_downtown/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const sounds = [];

export default sounds;
3 changes: 3 additions & 0 deletions src/sounds/map_seaside/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const sounds = [];

export default sounds;

0 comments on commit 2e2970a

Please sign in to comment.