我已经在互联网上搜索了将近五天,现在正在寻找解决这个问题的方法,但我似乎无法自己找到并修复它,主要是因为我对Maven和PlayN都很新,所以我不完全确定我到底在想什么.但是,它显然在建立核心时嘶嘶作响.似乎它无法下载"神器过滤器",并且无法运行Surefire的测试.但是,我只是在猜测我不太了解的事情,尽管我一直在努力研究这些事情,就像疯了一样.非常非常感谢来自更有经验的人的任何帮助.我对此失去了理智.
[INFO] Building Synthesis Core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ synthesis-core ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ synthesis-core ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] skip non existing resourceDirectory C:\Users\Josiah\synthesis\core\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3:compile (default-compile) @ synthesis-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ synthesis-core ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to …
Run Code Online (Sandbox Code Playgroud) 我一直在关注入门教程,但在使用Maven导入playn项目后卡住了.我正在使用在64位Windows 7上运行的Eclipse Indigo.
所有导入的项目都有相同的错误:
Missing Artifact com.sun:tools:jar in all the pom.xml files.
Run Code Online (Sandbox Code Playgroud)
经过几个小时的搜索论坛,我尝试过:
安装最新的Java 1.6.029更改JAVA_HOME
环境变量以指向\program files\Java\jdk1.6_029
更改Eclipse Java首选项以使用JRE jdk1.6_029
.
我真的想尝试playn,但为什么有一些帖子我似乎无法找到解决方案的共识答案.有人说Sun从64位jdk中删除了一些东西,其他人说你必须编辑你的xml文件,很多人说你已经改变了你的JAVA_HOME
,另一个人说你必须改变Eclipse的VM选项.
任何有关清除此功能的帮助都会受到赞赏,并且可能对许多人有用,因为我这里没有特别奇怪的设置.
(编辑)这是第一个项目中的pom.xml.Eclipse标记行中的错误:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-project</artifactId>
<version>1.1-SNAPSHOT</version>
</parent>
<artifactId>playn-android</artifactId>
<name>PlayN Android</name>
<packaging>jar</packaging>
<repositories>
</repositories>
<dependencies>
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- needed because Android uses the same JSON code as playn-java;
that should be factored into a library shared by both backends -->
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-java</artifactId>
<version>${project.version}</version>
</dependency>
<dependency> …
Run Code Online (Sandbox Code Playgroud) 我试图构建PlayN示例项目:
Missing artifact com.sun:tools:jar:1.6 pom.xml /playn-cute line 6 Maven Dependency Problem
Run Code Online (Sandbox Code Playgroud)
在每个pom.xml
文件上.我该如何解决?
编辑:
我已将配置文件节点添加到pom.xml
,但错误仍然存在.我已经检查过tools.jar
它确实存在,而它没有.所以我已经添加tools.jar
到lib文件夹了.仍然存在错误.
完整的pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-project</artifactId>
<version>1.0.1</version>
</parent>
<artifactId>playn-cute</artifactId>
<name>PlayN Cute Metaproject</name>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<playn.version>1.0.1</playn.version>
</properties>
<modules>
<module>core</module>
<module>java</module>
<module>html</module>
<!-- <module>flash</module> -->
<module>android</module>
</modules>
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<property>
<name>java.vendor</name>
<value>Sun Microsystems Inc.</value>
</property>
</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.6</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles> …
Run Code Online (Sandbox Code Playgroud) 我在Android上播放声音时遇到问题.我已将以下代码添加到我的项目中:
import playn.core.Sound;
...
@Override
public void init() {
Sound bg = assets().getSound("bg");
bg.play();
...
}
Run Code Online (Sandbox Code Playgroud)
我运行时代码按预期工作mvn test -Pjava
.声音播放没有问题.但是,当我运行mvn -Pandroid install
声音不播放.我没有在logcat或任何东西中得到任何错误,游戏只是沉默.
我试过了:
我发现在没有声音的情况下运行mvn install
而不是mvn test -Pjava
加载桌面版本.这让我觉得安装命令可能存在问题,但我只是在这里猜测.
关于如何在Android上使声音工作的任何想法?
我想用PlayN创建一个客户/服务器卡片游戏,例如Hearts.虽然我主要关注的是HTML5输出,但我理想的是,如果我决定将来制作一个Android客户端,我希望能够与输出平台无关.我该如何处理RPC机制?
这些是我想到的选项:
GWT.create(MyService.class)
(或至少是它的包装器)生成的GWT Async接口.我不知道这对非HTML版本有多好.我可以直接从客户端Java代码使用GWT-RPC吗?当我尝试用HTML编译游戏时,我遇到了一个奇怪的问题.(我搜索了其他主题,他们指的是进口非法包裹的人,我不是.)
所以基本上,在我的主要包中调用的每个类都在我的主包之外调用了这个错误.这些类都是由我实现的,他们不会导入任何非法的东西(没有反射,没有I/O,只有自制类和jbox2d).似乎它忽略了导入或类似的东西.
为了测试这个,我创建了一个名为Test的空类.当它在我的主要包装中时我没有得到任何错误,而当我把它移到外面时,我得到了:
[INFO] [ERROR]第73行:没有源代码可用于类型progetto.saga.map.Test; 你忘了继承一个必需的模块吗?
在第73行,我就是这么做的 Test test = new Test()
这是我的.gwt.xml文件:
<module rename-to='theknowledgetower'>
<inherits name='playn.PlayN'/>
<inherits name='TheKnowledgeTowersAssets'/>
<source path='core'/>
<source path='html'/>
<public path="resources" />
<entry-point class='progetto.saga.html.TheKnowledgeTowersHtml'/>
</module>
Run Code Online (Sandbox Code Playgroud)
你们有什么想法吗?
编辑:这是我得到的错误(我在我的主程序包之外的主类中的每个自定义类都得到它)
[INFO] [ERROR] Line 53: No source code is available for type progetto.saga.navigable.Navigable; did you forget to inherit a required module?
[INFO] [ERROR] Line 59: No source code is available for type progetto.saga.entity.dynamicentity.Player; did you forget to inherit a required module?
[INFO] [ERROR] Line 110: No source code is available …
Run Code Online (Sandbox Code Playgroud) 免责声明:我是GWT/PlayN的新手,所以这可能是我正在犯的一个明显的错误.
当我有一个基本的(首发)PlayN项目,我的BlahGame
类方法实现了Game
接口,这需要三个方法:init
,paint
,和update
.入门类看起来像:
public class BlahGame implements Game {
public void init() { ... }
public void paint(float alpha) { ... }
public void update(float alpha) { ... }
}
Run Code Online (Sandbox Code Playgroud)
我创建了一个BaseGame
实现游戏的类,如下所示:
public class BaseGame implements Game {
public void init() { ... }
public void paint(float alpha) { ... }
public void update(float alpha) { ... }
}
Run Code Online (Sandbox Code Playgroud)
我的主要游戏类然后变成了这样的子BaseGame
类:
public class BlahGame extends BaseGame {
public void …
Run Code Online (Sandbox Code Playgroud) 我正在制作一款游戏,这是用户可以注册头像的服务的一部分.问题是playn api似乎没有来自URL功能的任何加载图像(或者我可能有点盲目).
我错过了API的一些重要部分??? 不应该把这个功能放在PlayN.graphics()
??
有没有办法在PlayN中以编程方式触发iOS和Android上的虚拟键盘?像Gdx.input.setOnscreenKeyboardVisible(true);
LibGDX中的东西.
我能找到的最好的是键盘界面,但据我所知,这只能从用户那里获得整行,但我需要每个字符(按键)反馈.