简体   繁体   English

是否有Java等价于Processing中的draw()?

[英]Is there a Java equivalent to draw() from Processing?

I've recently started working on a game in Java, as I have taken an AP class I'm already very familiar with a lot of the logic in java, but still have lots to learn. 我最近开始用Java开发游戏,因为我参加了AP课程,我已经非常熟悉Java中的许多逻辑,但是仍然有很多东西需要学习。 I have a lot of experience using Processing where there is a void draw() function that gets called every frame to allow for updates. 我在使用Processing时有很多经验,在该过程中有一个void draw()函数会在每个帧中调用以允许更新。 I was wondering if there is anything of the same nature that I can use or how I would go about doing something like this if there isn't. 我想知道是否可以使用相同性质的东西,或者如果没有,我将如何去做这样的事情。 Thanks! 谢谢!

Yes...it's called Processing. 是的...这叫做处理。 I just looked, and Processing is written in Java, and it's Open Source. 我只是看了一下,而Processing是用Java编写的,它是开源的。 So you can use it as a starting point for any game you wanted to write. 因此,您可以将其用作想要编写的任何游戏的起点。 All the functionality would be there for you to make use of by calling existing code, and modifying it where necessary to be able to make such calls. 您可以通过调用现有代码并在必要时对其进行修改以进行此类调用来使用所有功能。 I don't know if this is supported by the project or not. 我不知道这个项目是否支持。

If you are a beginner, there are probably easier options. 如果您是初学者,可能会有更简单的选择。 There are other OpenGL and game engines and frameworks written in Java for use by Java programmers. 还有其他用Java编写的OpenGL和游戏引擎以及框架,供Java程序员使用。 You can Google "java game framework" to get a bunch of options. 您可以通过Google“ java游戏框架”获得很多选择。 One link that shows up near the top that talks about a few game engines is: 顶部附近出现的一个链接,上面讨论了一些游戏引擎:

https://github.com/AlmasB/FXGL/wiki/Java-Game-Frameworks https://github.com/AlmasB/FXGL/wiki/Java-Game-Frameworks

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM