简体   繁体   中英

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. I have a lot of experience using Processing where there is a void draw() function that gets called every frame to allow for updates. 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. 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. You can Google "java game framework" to get a bunch of options. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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