background picture of the home page

Hi,Friend

java游戏开发入门(五) - 碰撞机制

本文介绍了如何使用FXGL在Java游戏开发中处理不同实体之间的碰撞。通过枚举定义实体类型,创建Gold和Player实体,并分别设置它们的属性,例如类型、可碰撞性以及大小和颜色。 文章重点讲解了如何利用`CollisionHandler`处理Player和Gold实体之间的碰撞,在碰撞发生时从游戏中移除Gold实体。代码示例清晰地展示了实体的创建、类型声明以及碰撞处理的实现。最后提供了一个GitHub项目链接,供读者参考完整代码。

thumbnail of the cover of the post

java游戏开发入门(四) - 输入or控制

本文介绍了使用FXGL框架进行Java游戏开发,实现玩家基本控制的方法。文章重点讲解了如何使用静态方法操作引擎,并提供了代码示例,包括初始化玩家实体和处理按键输入(上下左右移动)。代码中使用了`FXGL.spawn()`方法创建玩家实体,并通过`onKey()`方法监听按键,实现玩家移动。文中还强调了使用静态方法的优势以及官方推荐的最佳实践。

thumbnail of the cover of the post

java游戏开发入门(三) - 实体

本文介绍了如何使用FXGL框架在Java中创建游戏实体,特别是玩家实体。文章首先创建了一个名为DemoEntityFactory的实体工厂,并实现了EntityFactory接口。然后,该工厂实现了newPlayer方法,用于创建玩家实体,并使用Rectangle创建玩家的视图。最后,文章展示了如何注册实体工厂,并在游戏界面中间生成玩家实体,并提供了完整的代码示例。

thumbnail of the cover of the post

java游戏开发入门(二) - 菜单

本文介绍了使用FXGL引擎在Java中创建游戏菜单的方法。通过设置`settings.setMainMenuEnabled(true)`和`settings.setGameMenuEnabled(true)`,可以启用主菜单和游戏内菜单。文章提供了Java代码示例和主菜单、游戏内菜单的截图,并附上了完整项目的GitHub链接。 该教程是Java游戏开发入门系列文章的第二篇,涵盖了菜单的创建和显示,并链接了系列的其他文章。

thumbnail of the cover of the post

java游戏开发入门(一) - HelloWorld

本文介绍了使用Java和FXGL引擎开发游戏的入门步骤,包括开发环境配置(IntelliJ IDEA 2021.3.2,Java 17,Maven 3.8.1,FXGL 17,javaFX)和创建第一个游戏程序“Hello World”。文章详细讲解了Maven依赖的配置、启动类HelloWorldApp的创建和实现,以及初始化游戏设置(窗口大小、标题),并提供了一个可运行的Java代码示例。文章还包括了项目的GitHub链接和后续文章的链接。 最终目标是创建标题为"Hello world"、尺寸为600x600像素的游戏窗口。

thumbnail of the cover of the post

java CRC32

本文介绍了Java中CRC32的实现方法。首先,它展示了使用Java官方提供的CRC32类进行计算的示例代码,包括初始化、数据更新和获取结果。其次,它给出了一个自行实现CRC32算法的代码示例,并阐述了计算步骤。最后,它也提供了MPEG-2标准下CRC32的实现方法,同样包含了相应的代码示例。

thumbnail of the cover of the post

SQLyog 使用指南及资源更新

用户ttrar获得三个激活码:8d8120df-a5c3-4989-8f47-5afc79c56e7c、59adfdfe-bcb0-4762-8267-d7fccf16beda和ec38d297-0543-4679-b098-4baadf91f983。软件更新功能应关闭。相关文件下载地址为https://wwws.lanzouo.com/ilAZY2c2yv6d,密码为3zaw。文章内容与关键词Mysql,SQLyog 使用指南及资源更新无关。

thumbnail of the cover of the post

LINUX | 防火墙开放端口

使用firewall-cmd命令可以检查和管理Linux防火墙的端口。首先,使用`firewall-cmd --query-port=80/tcp --zone=public`检查端口80是否开启,返回yes表示开启,no表示未开启。要开启端口,运行`firewall-cmd --zone=public --add-port=80/tcp --permanent`命令,修改端口号即可。若防火墙未运行,需先运行`systemctl start firewalld`启动防火墙,并确认启动成功。最后,记得重启服务器使更改生效。

thumbnail of the cover of the post

proj编译安装

This article details the compilation and installation of PROJ (Cartographic Projections library) version 9.4.1 on a Linux system. It outlines the steps involved: downloading the source code, extracting the archive, installing necessary dependencies (sqlite-devel, libtiff-devel, libcurl-devel using yum), configuring the installation prefix using cmake, compiling the code using make, and finally installing the compiled library using make install. The installation directory is specified as /usr/local/proj_9.

thumbnail of the cover of the post