Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 23:17

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Snake Game + Question about percent chance

Discussion on Snake Game + Question about percent chance within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Question Snake Game + Question about percent chance

Hi, i made this code for "the snake game" with autoit and was thinking about adding some buff/debuffs to the game so it can be challenging...


The thing is that don't know how to make it work ->

For example lets say we have, but i don't want to be all 25% each

Buffs:
-Invulnerable -> 15%
-Speed Down -> 30%
-U can eat Yourself ->15%
-Change Color -> 40%

Debuffs:
-Crazy snake (switch between controls) -> 15%
-Speed Up -> 20%
-Invisible Tail -> 20%
-Doubles your size -> 15%

How can i make it work that way with autoit (?
I don't want someone to share a code and thats it, a good example or explanation will be good.
Finally i want to know if the drawing functions are okay that way or i'm overdrawing all the time wasting cpu usage...

Here is the code if anyone wants to have fun for a while :d


Need files:

Optional ->

I know the code looks bad, very sorry about that :c
elmarcia is offline  
Old 03/06/2015, 21:25   #2
 
alpines's Avatar
 
elite*gold: 60
Join Date: Aug 2009
Posts: 2,256
Received Thanks: 815
Just think about what you want to do and how to solve such problems. Write down the things the program should do (in order) and convert them to valid AutoIt-Code.
alpines is offline  
Thanks
1 User
Old 03/06/2015, 23:31   #3
 
elite*gold: 0
Join Date: Apr 2011
Posts: 363
Received Thanks: 167
Quote:
Originally Posted by alpines View Post
Just think about what you want to do and how to solve such problems. Write down the things the program should do (in order) and convert them to valid AutoIt-Code.
Hi!

I've been thinking for a while and came with the solution.

Here is what i get. A simple way of getting random buffs with different percent each other.

elmarcia is offline  
Reply

Tags
autoit, code, game, percent, snake


Similar Threads Similar Threads
kleines Snake Game
08/20/2013 - Coding Releases - 6 Replies
Hey, habe mal Just 4 Fun ein kleines Snake Game gebastelt. (in VB.net) Den Code gibts auf Anfrage mitdazu! Für Leute dies intressiert. Können noch einige Bugs drin sein. Steuerung ist: W: Hoch D: Rechts A: Links
[Biete/Sell] 3D Snake-Game
10/10/2012 - Coding Releases - 3 Replies
Sourcecode selled:)
[Biete/Sell] 3D Snake-Game
10/10/2012 - elite*gold Trading - 4 Replies
#Sourcecode selled



All times are GMT +1. The time now is 23:18.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.