开发者

How do I have a picture act as a game character on top of a canvas?

开发者 https://www.devze.com 2023-01-30 14:38 出处:网络
I have a maze game in JAVA I\'m doing for a class, the maze is made on a canvas in an applet, I wanted to have another picture provided to me (of a statue like thing) act as a game character and be ab

I have a maze game in JAVA I'm doing for a class, the maze is made on a canvas in an applet, I wanted to have another picture provided to me (of a statue like thing) act as a game character and be able to be moved around the maze by the arrow keys, so how do I place an object on a canvas that can move开发者_开发问答 around and be controlled, etc.? At the moment, the only way I could get my statue on the maze was by just copying the pixels of the picture onto the maze, so it's just part of the background now...Please help me! I've been posting everywhere looking for help to no avail.


Above the ContentPane you will find that exists a GlassPane. It is the right place to add your statue picture without messing with the background.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号