Snake3D: Released Version 1.1 containing an upgrade of the GUI. by quantumdeveloper

View this thread on steempeak.com
· @quantumdeveloper ·
$13.27
Snake3D: Released Version 1.1 containing an upgrade of the GUI.
#### Repository
https://github.com/IntegratedQuantum/Snake3D

### New Features
The menu GUI now contains several buttons which can be pressed with the mouse:
![Screenshot from 2019-07-24 23-08-18.png](https://cdn.steemitimages.com/DQme4kw2vTrSdZskZo5pD9PjwfGbG229ov5A7gZQXkD9z7T/Screenshot%20from%202019-07-24%2023-08-18.png)
The buttons are triggered using the java MouseListener which I added [here](https://github.com/IntegratedQuantum/Snake3D/commit/dca337d301d8c748f040aca11688457f68ea5d75).
The buttons simply consist of one Rectangle containing a text that changes color if the mouse was pressed above it. The level and difficulty selection is also indicated by another color.
The [Start button](https://github.com/IntegratedQuantum/Snake3D/commit/133a79c8e7ac66edd842791841313d89d3d7c5ec) simply starts the game, but space can still be used for that.
Difficulty and level can now be selected [using the mouse](https://github.com/IntegratedQuantum/Snake3D/commit/1e4c95f93f6d86ed9abeca6a2d7cc86aa090b086) or you can[ cycle through them with G(for the difficulty) and L(for the level)](https://github.com/IntegratedQuantum/Snake3D/commit/d867b0fb3fceb9a561546c26437f5ef87f2de286).
Now that level and difficulty are seperated it has also become possible to select a level in hard mode:
![Screenshot from 2019-07-25 12-12-21.png](https://cdn.steemitimages.com/DQmZMt3ifRoJTJ3YF9hxXPndajSmMC6mthEwTGEXqR2V8Uw/Screenshot%20from%202019-07-25%2012-12-21.png)
The death-screen pretty much remained the same, but you now have to leave it [pressing any key](https://github.com/IntegratedQuantum/Snake3D/commit/854cc0c2b5311afc43ed08d9904d219129fd549f) to start a new game. I made it this way so the death-screen isn't overloaded with the same details as the main-screen having also the "Game Over" at the position where the start button would be.

### Minor changes
- [Use a deque](https://github.com/IntegratedQuantum/Snake3D/commit/dc9664b71a19b99c7d8f6614ffec714c9a4f48d9) to store the snake's segments as suggested by @justyy [here](https://steemit.com/utopian-io/@justyy/pv0dtp).
- [All references to colors are now referencing Assets](https://github.com/IntegratedQuantum/Snake3D/commit/a31e83e467f13774a0ed1faea6ca687d0cf254e2) which allows in future to change them in the settings.
- The cube now automatically rotates slowly in the main menu.
- The sorting algorithm in `Graphics3D.update()` [is now more general](https://github.com/IntegratedQuantum/Snake3D/commit/eab75e41d3d43ff35c4d18f0b93b866fced2b861).
- Previously when a new level was added all your scores were gone, but that is [fixed](https://github.com/IntegratedQuantum/Snake3D/commit/4232a0f202a6dd5799df96e1394d57eadd2bafd2) now.
- The [github readme.md has now an image](https://github.com/IntegratedQuantum/Snake3D/commit/3dcf7c71525b4b8f70f23b0f0fae61178ccb9732).

#### GitHub Account
https://github.com/IntegratedQuantum
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id78,380,407
authorquantumdeveloper
permlinksnake3d-released-version-1-1-containing-an-upgrade-of-the-gui
categoryutopian-io
json_metadata{"tags":["utopian-io","development","programming","quantumdeveloper","palnet"],"users":["justyy"],"image":["https:\/\/cdn.steemitimages.com\/DQme4kw2vTrSdZskZo5pD9PjwfGbG229ov5A7gZQXkD9z7T\/Screenshot%20from%202019-07-24%2023-08-18.png","https:\/\/cdn.steemitimages.com\/DQmZMt3ifRoJTJ3YF9hxXPndajSmMC6mthEwTGEXqR2V8Uw\/Screenshot%20from%202019-07-25%2012-12-21.png"],"links":["https:\/\/github.com\/IntegratedQuantum\/Snake3D","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/dca337d301d8c748f040aca11688457f68ea5d75","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/133a79c8e7ac66edd842791841313d89d3d7c5ec","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/1e4c95f93f6d86ed9abeca6a2d7cc86aa090b086","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/d867b0fb3fceb9a561546c26437f5ef87f2de286","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/854cc0c2b5311afc43ed08d9904d219129fd549f","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/dc9664b71a19b99c7d8f6614ffec714c9a4f48d9","https:\/\/steemit.com\/utopian-io\/@justyy\/pv0dtp","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/a31e83e467f13774a0ed1faea6ca687d0cf254e2","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/eab75e41d3d43ff35c4d18f0b93b866fced2b861","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/4232a0f202a6dd5799df96e1394d57eadd2bafd2","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/3dcf7c71525b4b8f70f23b0f0fae61178ccb9732","https:\/\/github.com\/IntegratedQuantum"],"app":"steemit\/0.1","format":"markdown"}
created2019-07-26 19:18:06
last_update2019-07-26 19:18:06
depth0
children9
net_rshares38,361,813,008,198
last_payout2019-08-02 19:18:06
cashout_time1969-12-31 23:59:59
total_payout_value10.055 SBD
curator_payout_value3.216 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length2,895
author_reputation4,501,252,062,061
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (38)
@steemitboard ·
Congratulations @quantumdeveloper! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td><img src="https://steemitimages.com/60x70/http://steemitboard.com/@quantumdeveloper/votes.png?201907261052"></td><td>You distributed more than 300 upvotes. Your next target is to reach 400 upvotes.</td></tr>
</table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@quantumdeveloper) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=quantumdeveloper)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>


To support your work, I also upvoted your post!


> You can upvote this notification to help all Steem users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
properties (22)
post_id78,381,890
authorsteemitboard
permlinksteemitboard-notify-quantumdeveloper-20190726t201608000z
categoryutopian-io
json_metadata{"image":["https:\/\/steemitboard.com\/img\/notify.png"]}
created2019-07-26 20:16:06
last_update2019-07-26 20:16:06
depth1
children0
net_rshares0
last_payout2019-08-02 20:16:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length910
author_reputation38,705,954,145,809
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@justyy ·
$4.87
Thank you for your contribution.

1. You could use the custom sorting in Java instead of writing your own sorting [here](https://github.com/IntegratedQuantum/Snake3D/commit/eab75e41d3d43ff35c4d18f0b93b866fced2b861)
2. You might use Arrays.fill instead in [here](https://github.com/IntegratedQuantum/Snake3D/commit/a31e83e467f13774a0ed1faea6ca687d0cf254e2#diff-630c47531b8e58b35870e9df0de84ae9L450) if the array is continous.
3. duplicate code could be refactored: [here](https://github.com/IntegratedQuantum/Snake3D/commit/1e4c95f93f6d86ed9abeca6a2d7cc86aa090b086#diff-8b010567be8b321974ebff2081634144L32) and [here](https://github.com/IntegratedQuantum/Snake3D/commit/133a79c8e7ac66edd842791841313d89d3d7c5ec#diff-d0c8895c74c521a53ea94bc0005dbd3eR31)


Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2-2-2-2-2-1-1-).

---- 
Need help? Chat with us on [Discord](https://discord.gg/uTyJkNm).

[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id78,450,966
authorjustyy
permlinkpvd48u
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/eab75e41d3d43ff35c4d18f0b93b866fced2b861","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/a31e83e467f13774a0ed1faea6ca687d0cf254e2#diff-630c47531b8e58b35870e9df0de84ae9L450","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/1e4c95f93f6d86ed9abeca6a2d7cc86aa090b086#diff-8b010567be8b321974ebff2081634144L32","https:\/\/github.com\/IntegratedQuantum\/Snake3D\/commit\/133a79c8e7ac66edd842791841313d89d3d7c5ec#diff-d0c8895c74c521a53ea94bc0005dbd3eR31","https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/3\/2-2-2-2-2-1-1-","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"],"app":"steemit\/0.1"}
created2019-07-28 17:22:06
last_update2019-07-28 17:22:06
depth1
children3
net_rshares14,140,089,047,173
last_payout2019-08-04 17:22:06
cashout_time1969-12-31 23:59:59
total_payout_value3.706 SBD
curator_payout_value1.159 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length1,202
author_reputation2,057,469,156,047,835
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (24)
@quantumdeveloper ·
Thanks for your review.
1. It is hard to sort an array if the array itself does not also contain the data that it should be sorted by.
2. Yes I could do that, but that wouldn't improve readability (I could only replace the innermost loop which doesn't make a big difference in readability), but it would also mean an unnecessary drop in performance based on the data mentioned [here](https://stackoverflow.com/questions/9128737/fastest-way-to-set-all-values-of-an-array) in the second answer.
3. You are right. I was thinking about making a new class "Button", but that has some complications so I decided to keep it as it is for now(until the next update).
properties (22)
post_id78,456,728
authorquantumdeveloper
permlinkpvddh1
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https:\/\/stackoverflow.com\/questions\/9128737\/fastest-way-to-set-all-values-of-an-array"],"app":"steemit\/0.1"}
created2019-07-28 20:41:27
last_update2019-07-28 20:41:27
depth2
children0
net_rshares0
last_payout2019-08-04 20:41:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length657
author_reputation4,501,252,062,061
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
Thank you for your review, @justyy! Keep up the good work!
properties (22)
post_id78,547,736
authorutopian-io
permlinkre-pvd48u-20190731t081029z
categoryutopian-io
json_metadata{"app":"beem\/0.20.17"}
created2019-07-31 08:10:30
last_update2019-07-31 08:10:30
depth2
children0
net_rshares0
last_payout2019-08-07 08:10:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length58
author_reputation152,913,012,544,965
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@surpassinggoogle ·
#utopian-io has been a gift. We would like to keep its curation-efforts alive here on 'marlians.com'. We want to curate and reward 'contributions to open-source projects' with [MARLIANS](https://steem-engine.com/?p=market&t=MARLIANS) on the the marlians.com tribe, a SCOT-enabled steem condenser. Contributions can include suggestions, graphics, bug-finds, code etc. You can simply add in #marlians to your #utopian-io posts and it will appear on https://www.marlians.com/created/utopian enabling you to earn some MARLIANS along with steem/sbd. You can also post directly to steem via 'marlians.com'. We have some overseers who curate and who can render you help too. You can find them enlisted on https://www.marlians.com/created/utopian
properties (22)
post_id78,803,924
authorsurpassinggoogle
permlinkpvv66n
categoryutopian-io
json_metadata{"tags":["utopian-io","marlians"],"links":["https:\/\/steem-engine.com\/?p=market&t=MARLIANS","https:\/\/www.marlians.com\/created\/utopian"],"app":"steemit\/0.1"}
created2019-08-07 11:20:51
last_update2019-08-07 11:20:51
depth2
children0
net_rshares0
last_payout2019-08-14 11:20:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length738
author_reputation508,940,095,151,809
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@utopian-io ·
Hey, @quantumdeveloper!

**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
post_id78,456,075
authorutopian-io
permlinkre-snake3d-released-version-1-1-containing-an-upgrade-of-the-gui-20190728t201816z
categoryutopian-io
json_metadata{"app":"beem\/0.20.17"}
created2019-07-28 20:18:18
last_update2019-07-28 20:18:18
depth1
children0
net_rshares0
last_payout2019-08-04 20:18:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length598
author_reputation152,913,012,544,965
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@ceattlestretch ·
Looks like a fun game by the way πŸ‘
πŸ‘  
properties (23)
post_id78,489,275
authorceattlestretch
permlinkpvezuv
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit\/0.1"}
created2019-07-29 17:42:30
last_update2019-07-29 17:42:30
depth1
children0
net_rshares1,469,492,466
last_payout2019-08-05 17:42:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length34
author_reputation1,552,784,227,789
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@mapxv ·
Thanks for being one of the first to buy the new MAPXV tokens. A freebie upvote as a thank you!
properties (22)
post_id78,556,431
authormapxv
permlinkpvie1f
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit\/0.1"}
created2019-07-31 13:41:39
last_update2019-07-31 13:41:39
depth1
children0
net_rshares0
last_payout2019-08-07 13:41:39
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length95
author_reputation9,672,874,554,958
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@surpassinggoogle ·
#utopian-io has been a gift. We would like to keep its curation-efforts alive here on 'marlians.com'. We want to curate and reward 'contributions to open-source projects' with [MARLIANS](https://steem-engine.com/?p=market&t=MARLIANS) on the the marlians.com tribe, a SCOT-enabled steem condenser. Contributions can include suggestions, graphics, bug-finds, code etc. You can simply add in #marlians to your #utopian-io posts and it will appear on https://www.marlians.com/created/utopian enabling you to earn some MARLIANS along with steem/sbd. You can also post directly to steem via 'marlians.com'. We have some overseers who curate and who can render you help too. You can find them enlisted on https://www.marlians.com/created/utopian
properties (22)
post_id78,803,915
authorsurpassinggoogle
permlinkpvv669
categoryutopian-io
json_metadata{"tags":["utopian-io","marlians"],"links":["https:\/\/steem-engine.com\/?p=market&t=MARLIANS","https:\/\/www.marlians.com\/created\/utopian"],"app":"steemit\/0.1"}
created2019-08-07 11:20:36
last_update2019-08-07 11:20:36
depth1
children0
net_rshares0
last_payout2019-08-14 11:20:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length738
author_reputation508,940,095,151,809
root_title"Snake3D: Released Version 1.1 containing an upgrade of the GUI."
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000