chriscloyd Posted July 25, 2012 Share Posted July 25, 2012 I am creating a turn based game for my programming class. I am creating a hustle function to "hustle" drugs/ deal drugs I have a "study" section and the higher you learn about the drug you are hustling the more you will sale. My Question is does anyone have an idea of what to do. If I am not making sense let me know but for now I will show you and example say my player has 21 pounds of weed to sale. he has 6 hustlers that is part of his crew and he has increased his study to stage 11 which % is 44% So I am looking to see what would work best if the user wanted to use 6 turns to sale/hustle 21 pounds of weed. Any suggestion. I have part of the script coded but nothing but setting the variables.... Quote Link to comment https://forums.phpfreaks.com/topic/266211-game-hustle-function/ Share on other sites More sharing options...
.josh Posted July 25, 2012 Share Posted July 25, 2012 Perhaps if you stop smoking the weed, your mind will be more clear... Also, do you really think your teacher is going to like seeing a game about drug dealing? Do you really think nobody is going to start eyeballing you more for this? Running around telling the whole world "HEY I SMOKE WEEEED!!" is a good way to put yourself in a position of NOT getting to smoke weed. Just sayin'... Quote Link to comment https://forums.phpfreaks.com/topic/266211-game-hustle-function/#findComment-1364229 Share on other sites More sharing options...
Jessica Posted July 25, 2012 Share Posted July 25, 2012 Agreed. I remember in high school there was a popular game about drugs and pimps. If one of the kids got caught playing it they got in trouble. And that was just PLAYING it. Make it school friendly. Next, post code and an exact problem, and we can help debug. But if you're just asking "how should I program this part of my game", well you're the programmer. Quote Link to comment https://forums.phpfreaks.com/topic/266211-game-hustle-function/#findComment-1364237 Share on other sites More sharing options...
xyph Posted July 25, 2012 Share Posted July 25, 2012 Hey! I smoke weed! (Well mostly eat it now, it's much kinder to the respiratory system)... but it's for medical and I generally only use it as a sleep aid and for diet. Can't get any work done with a clouded head This issue is pretty simple. For each turn, any given 'hustler' has a 44% chance to sell a given amount (say 1lb). <?php if(rand(1,100) <= $study_percent) { // 1 lb was sold } ?> To do that for all 6 hustlers <?php for($i = 0; $i < $hustler_count; $i++) { if(rand(1,100) <= $study_percent) { // 1 lb was sold } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/266211-game-hustle-function/#findComment-1364260 Share on other sites More sharing options...
spiderwell Posted July 27, 2012 Share Posted July 27, 2012 i would add caveat but im too stoned to bother Quote Link to comment https://forums.phpfreaks.com/topic/266211-game-hustle-function/#findComment-1364842 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.