Web应用程序
这是一个基于Angular 4的基于Web的查找地图游戏网站。它具有多种选择游戏模式,并基于选择模式运行,许多区域可以选择/选择,或者仅一个区域然后填充国家/地区名称即可进行查找每个周期。
正确的行为是什么
*所有数据均来自SVG文档
游戏模式
LearningMode =总是重复游戏
ClassicMode =仅运行一次并结束
TimeMode =有时间限制,否则游戏结束
这是处理点击事件的部分代码
public handleClickEvent(event: any): void {
if (this.gameStarted && event.path && event.path.length > 0) {
const country = event.path[0].id;
if (
country !== null &&
country !== 'europeanMap' &&
country !== 'image97'
) {
this.runGameLogic(country);
}
}
}
游戏运行逻辑
// The user clicked on the map, so run game logic on that
private runGameLogic(selectedCountryName: string): void {
const index = this.selectedCountries.findIndex(country => {
return country.name === this.countryToFind.name;
});
this.selectedCountries[index].selected = true;
// Only run logic if the game has started, there is a valid countryName object, and that object is not equal to an empty string
if (selectedCountryName && selectedCountryName !== '') {
if (selectedCountryName === this.countryToFind.name) {
this.correctAnswerLogic(index);
this.selectedCountries[index].correct = true;
} else {
this.incorrectAnswerLogic(index, selectedCountryName);
}
}
}
我需要弄清楚如何制作跨浏览器功能的应用程序,或者浏览器确实支持我的应用程序的可能解决方案。
感谢您的帮助:)
答案 0 :(得分:0)
我找到了Firefox浏览器的解决方案。原因是Firefox没有ffmpeg.exe -y -i C:\Users\Andy\Desktop\entrada\intros/intro_720.mp4 -i C:\Users\Andy\Desktop\entrada\videoplayback.mp4 -i watermark.png -filter_complex [1:v]subtitles=tmp/Heartstrings_1.ass[v1];[v1][2]overlay=x=0:y=0[v1]; [0:v] [0:a] [v1] [1:a] concat=n=2:v=1:a=1 [v] [a]; [v]split=2[v720][v360];[v720]scale=1280:720[v720];[v360]scale=640:360[v360];[a]asplit=2[a1][a2] -map [v720] -map [a1] C:\Users\Andy\Desktop\salida/720_videoplayback.mp4 -map [v360] -map [a2] C:\Users\Andy\Desktop\salida/360_videoplayback.mp4
属性,虽然我发现event.path
可以运行所有主流浏览器,但没有触发event.composedPath()
事件,但Mozilla Documentation中的Edge / IE除外。 。
这是在Firefox上可以正常运行的实际代码。
public handleClickEvent(event: any): void {
const path = event.path || event.composedPath();
if (this.gameStarted && path && path.length > 0) {
const country = path[0].id;;
if (
// some conditions
) {
// do something
}
}
}
我仍然需要在Edge / IE浏览器中解决。 谢谢