Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User Interface ontop of canvas

w ras
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Playing around with making a 2d Tile game and looking around for a good way to proceed to the next level of my experiment. In the game, you will eventually have a player moving around, mobs to encounter, items to pickup or drop and buttons to push for skills or menus to take actions (like quit/save the game). How to proceed from here?

1: allow users to see/hide user interface (v on keyboard)
2: User Interface needs to be visible while the user plays the game.
3: buttons on a user interface which activate powers or menu/submenu.
4: mouse click to attack specific mob.
5: user inventory (i on keyboard) which can appear over the canvas.
6: Allow users to drag/drop items to/from inventory/game canvas.

I imagine when the mouse is pressed, it has to check the coord(x,y) vs some kind of layer. starting at the top working towards bottom until it finds the coord with an object on that level. Say game canvas is lowest level, game items (mobs, treasure) are above that, user interface next higher, user inventory even higher. Seem to recall when putting layers on in the past that the coord would only return for the highest level or something. This was many many years ago. Any ideas?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic