Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

#13 More Block Selecting (Minecraft 2D) -- Java Game Development (LWJGL)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
877 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 25, 2011

Episode 14: http://youtu.be/8ryJMO6rBT4
In this episode I'll cover creating a more sophisticated block selecting mechanism with transparent overlays, and occasional on-the-spot visual representations of the blocks we have selected.

Source Code: http://pastebin.com/JMtfGk72

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (TheCodingUniverse)

  • Why does it matter if you use public or private? I know what the difference is but why not just go ahead and make it all public?

  • @NerdsWBNerds Because making something publics implies that it should be used by external classes. It's generally a good habit to make everything private or protected if possible and have accessor methods handle the internal variables.

see all

All Comments (18)

Sign In or Sign Up now to post a comment!
  • @DKMeNIcE Damn, I must've been really tired or something. Glad you fixed the thing. 

  • @DKMeNIcE Solved it by changing the world sizes. Obviously it was changed after recording and it wasn't relayed to us. WIDTH of 21 and HEIGHT of 16 is what it should be.

  • My right and bottom boundaries aren't blocking the selection. I have the exact same code as you but it seems like World.BLOCKS_HEIGHT - 2 and World.BLOCKS_WIDTH - 2 just aren't the right numbers. You forgot to add the world.java to pastebin, however following this tutorial I set it to the same as you, 24 for the width and 20 for the height. In order to get my boundaries to work I need the resulting number to be 19 for right and 14 for the bottom. meaning -5 for right and -6 for down.

  • @TheCodingUniverse Soooo...Are you making a tutorial on the player or not? It seems if I make another class, I have to make all the ints static(lol) and if I make a void in the Boot class it won't work(lol).

  • @Williaml9518 Oh, lol, sorry, I didn't see that. My apologies.

  • @TheCodingUniverse What?! I wasn't off topic. I was just telling some other guy asking for help that I use JFrame only, not you!!!

  • @Williaml9518 Err, off-topic, I guess?

  • @cheater39 umm. I only use JFrame sorry.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more