Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wizard1146 authored Apr 25, 2024
1 parent b3a0d8f commit 82440b0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
17 changes: 16 additions & 1 deletion js/mg3.canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,21 @@ mg3.canvas = (function() {

if (hero) {
// move the hero first
/*
let h = units[hero.id]
let c = h.anim.current
if (h.actual.position.x == hero.x && h.actual.position.z == hero.y) {
if (h.anim.current != h.anim.keys.idle) {
h.anim.current = h.anim.keys.idle
h.AnimateIdle()
}
} else {
if (h.anim.current != h.anim.keys.walk) {
h.anim.current = h.anim.keys.walk
h.AnimateWalk()
}
}*/

units[hero.id]?.moveTo( hero.x, hero.y )
}
if (rest && rest.length) {
Expand Down Expand Up @@ -282,7 +297,7 @@ mg3.canvas = (function() {
if (datum.isPlayer) {
let sc = settings.canvas
eye = new BABYLON.ArcFollowCamera( sc.id_eye, sc.alpha, sc.beta, sc.radius, unit.actual, scene )
scene.setActiveCameraByID( sc.id_eye )
//scene.setActiveCameraByID( sc.id_eye )
}
// notify Comptroller
raiseEvent( canvas, events.canvas.unit_loaded, unit )
Expand Down
2 changes: 1 addition & 1 deletion js/mg3.engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mg3.engine = (function() {
// generate map

// generate player
let datum = UNITS['sentinel'] // MODIFY
let datum = UNITS['player'] // MODIFY
let player = generateUnit( datum.key, datum, true )
data.hero = player

Expand Down
13 changes: 11 additions & 2 deletions js/mg3.season.001.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ mg3.season_001 = (function(){
walk : `003_run_weaponshield`,
},
})

// HRM
UNITS[`ethnic`] = new Unit({
key: `ethnic`,
uri: `ethnic_hero`,
Expand All @@ -232,6 +230,17 @@ mg3.season_001 = (function(){
walk : `001_run_samurai_f`,
},
})

// Player
UNITS[`player`] = new Unit({
key: `player`,
uri: `ssp`,
scale: 1.22,
animationKeys: {
idle: `idle`,
walk: `walk`,
},
})

return {
LEVELS: LEVELS,
Expand Down

0 comments on commit 82440b0

Please sign in to comment.