Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: HUD and Controller  (Read 2106 times)

0 Members and 1 Guest are viewing this topic.
HUD and Controller
« on: February 21, 2010, 01:51:25 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Well I found a little bit of time again to work on something for the MC Engine. In this case I have been working on a HUD. At the moment it is only the buttons section, because it directly applies to the actions Link can do.

Okay, now about what I did. I made a new object called objController, my idea was that it can deal with things in the game that does not directly apply to entities in the world, like the HUD, menu, titlescreen and all that.

The HUD itself is only something that needs to be drawn on screen. Thus I put it in a script. At the moment it first draws the buttons and then the actions assigned to the buttons. With the actions two options popped in my mind:
1) Make a giant switch/if statement to see what icon needs to be drawn.
2) Call the scripts assigned to the buttons and let them paint the Icon needed.
The choice was simple, because the second option is a lot faster and far more modular when adding new actions to the engine. A new event was added to the constants denoted as 'HUD'.

At the same time I finished some last details on the Bow. In the last versions the Bow did nothing with the amount of arrows. Now I made two global variables:
1) cur_arrows = the number of arrows Link is currently holding.
2) max_arrows = the maximum number of arrows Link can hold.
The current number of arrows is given with the Bow Icon.

The Controller object is currently rather empty and small, but in time it can grow larger. But I did add something extra, which should not considered to be a part of the engine. Instead of stopping the engine to change actions assigned to the buttons or reset the arrow count, you can now do this by pressing 'PgUp' and 'PgDn'. On there own those buttons don't do much, but in combination with another you can change things.
'P' => changes the action assigned to the A button.
'O' => changes the action assigned to the B button.
'I' => increases and decreases the amount of cur_arrows.

I'd love to have some input, about how you guys would do this.

Enjoy!
« Last Edit: February 22, 2010, 09:25:07 am by Niek »
Logged
Re: HUD and Controller
« Reply #1 on: February 22, 2010, 09:30:38 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Okay, I have added hearts and ruppees.

L: changes the ruppee amount
K: changes the current hearts
J: changes the total number of hearts.


I really some input on about some of the design decisions.
Logged
Re: HUD and Controller
« Reply #2 on: February 24, 2010, 03:37:16 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Hey this is pretty neat, I tried it out a little but have been too busy to try and test/break it. Otherwise the way you coded actions has promise.
Logged
Re: HUD and Controller
« Reply #3 on: February 24, 2010, 05:38:24 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Hey this is pretty neat, I tried it out a little but have been too busy to try and test/break it. Otherwise the way you coded actions has promise.

Thnx, There is away to break it and that is if you select the same actions for both buttons. But then again it those keys were made for debug purposes and not to be used in game.

I have been playing some more with the HUD, making a graphical effect. Personally I think a graphical effect is not something for the engine, but I thought I would show it off nonetheless. But I did only make it for GM8. See attachment for the GMK.

And when running press 'Enter' to see the magic happen.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.051 seconds with 45 queries.

anything