Search Results

Search found 4 results on 1 pages for 'dillon'.

Page 1/1 | 1 

  • Ideas for attack damage algorithm (language irrelevant)

    - by Dillon
    I am working on a game and I need ideas for the damage that will be done to the enemy when your player attacks. The total amount of health that the enemy has is called enemyHealth, and has a value of 1000. You start off with a weapon that does 40 points of damage (may be changed.) The player has an attack stat that you can increase, called playerAttack. This value starts off at 1, and has a possible max value of 100 after you level it up many times and make it farther into the game. The amount of damage that the weapon does is cut and dry, and subtracts 40 points from the total 1000 points of health every time the enemy is hit. But what the playerAttack does is add to that value with a percentage. Here is the algorithm I have now. (I've taken out all of the gui, classes, etc. and given the variables very forward names) double totalDamage = weaponDamage + (weaponDamage*(playerAttack*.05)) enemyHealth -= (int)totalDamage; This seemed to work great for the most part. So I statrted testing some values... //enemyHealth ALWAYS starts at 1000 weaponDamage = 50; playerAttack = 30; If I set these values, the amount of damage done on the enemy is 125. Seemed like a good number, so I wanted to see what would happen if the players attack was maxed out, but with the weakest starting weapon. weaponDamage = 50; playerAttack = 100; the totalDamage ends up being 300, which would kill an enemy in just a few hits. Even with your attack that high, I wouldn't want the weakest weapon to be able to kill the enemy that fast. I thought about adding defense, but I feel the game will lose consistency and become unbalanced in the long run. Possibly a well designed algorithm for a weapon decrease modifier would work for lower level weapons or something like that. Just need a break from trying to figure out the best way to go about this, and maybe someone that has experience with games and keeping the leveling consistent could give me some ideas/pointers.

    Read the article

  • Coda-like experience for Ubuntu

    - by Dillon Gilmore
    I'm a web developer who's going to transition from using Mac OS X to Ubuntu. I've been using Coda for some time, only because it makes web development easy. I know a full fledged app isn't available for Linux, but would like to know about apps that specialize in the same tasks that Coda offers. I plan on switching to Vim for code editing, I'm extremely proficient and will install the Janus plugin and be good to go for editing code. One thing that makes editing on Coda so amazing is its extremely good at SFTP, you can drag and drop files and/or folders from your local drive to the server. Also, you can edit code directly on the server. The problem here, is that using Vim I don't know of a way to edit code on a remote server, while using my own Vim settings and plugins. To solve this, I would like to know of a good SFTP client OR a good SFTP CLI. A CLI that could synchronize your files after a file has been modified would be perfect, but not necessary. Now, one of the biggest and best features of Coda is its ability to view your databases. You get to create a database, create tables, add stuff, delete stuff and view the contents of the table (all this without writing a single SQL statement). I will admit that databases are my weak point, but is a very important part of my job. If there is a tool that specializes in databases would be perfect. I wouldn't prefer to use the command line for database stuff, but if there is a CLI for databases that I'm missing could potentially be useful. So I guess I'm asking for two things. A tool that makes databases easier to visualize and a tool that assists in pushing my local code to a server.

    Read the article

  • Using .add() on the same widget more than once

    - by Dillon Gilmore
    I asked this question on Reddit and was directed here. http://www.reddit.com/r/Ubuntu/comments/vhadl/quickly_dynamic_ui/ Unfortunately I am having the same issue and the problems seems that you can only use .add() on a widget once. So here is my code, self.ui.labels = [] for titles in entries: label = Gtk.Label() self.ui.labels.append(label) self.ui.viewport1.add(self.ui.labels[-1]) self.ui.paned1.show_all() Now, for fun I decided "What would happen if I just manually did..." self.ui.viewport1.add(Gtk.Label()) self.ui.viewport1.add(Gtk.Button()) self.ui.viewport1.add(Gtk.Entry()) For my first code snippet I get this error, Gtk-CRITICAL **: gtk_viewport_add: assertion gtk_bin_get_child (bin) == NULL' failed The error happens an unknown amount of times because the list entries can vary in length, but for my second code snippet it happens exactly twice. This means that when I viewport1.add() it works the first time, but all adds after that receive the error above. So my question, is there a way in python to use .add() on the same widget more than once?

    Read the article

  • Filtering documents against a dictionary key in MongoDB

    - by Thomas
    I have a collection of articles in MongoDB that has the following structure: { 'category': 'Legislature', 'updated': datetime.datetime(2010, 3, 19, 15, 32, 22, 107000), 'byline': None, 'tags': { 'party': ['Peter Hoekstra', 'Virg Bernero', 'Alma Smith', 'Mike Bouchard', 'Tom George', 'Rick Snyder'], 'geography': ['Michigan', 'United States', 'North America'] }, 'headline': '2 Mich. gubernatorial candidates speak to students', 'text': [ 'BEVERLY HILLS, Mich. (AP) \u2014 Two Democratic and Republican gubernatorial candidates found common ground while speaking to private school students in suburban Detroit', "Democratic House Speaker state Rep. Andy Dillon and Republican U.S. Rep. Pete Hoekstra said Friday a more business-friendly government can help reduce Michigan's nation-leading unemployment rate.", "The candidates were invited to Detroit Country Day Upper School in Beverly Hills to offer ideas for Michigan's future.", 'Besides Dillon, the Democratic field includes Lansing Mayor Virg Bernero and state Rep. Alma Wheeler Smith. Other Republicans running are Oakland County Sheriff Mike Bouchard, Attorney General Mike Cox, state Sen. Tom George and Ann Arbor business leader Rick Snyder.', 'Former Republican U.S. Rep. Joe Schwarz is considering running as an independent.' ], 'dateline': 'BEVERLY HILLS, Mich.', 'published': datetime.datetime(2010, 3, 19, 8, 0, 31), 'keywords': "Governor's Race", '_id': ObjectId('4ba39721e0e16cb25fadbb40'), 'article_id': 'urn:publicid:ap.org:0611e36fb084458aa620c0187999db7e', 'slug': "BC-MI--Governor's Race,2nd Ld-Writethr" } If I wanted to write a query that looked for all articles that had at least 1 geography tag, how would I do that? I have tried writing db.articles.find( {'tags': 'geography'} ), but that doesn't appear to work. I've also thought about changing the search parameter to 'tags.geography', but am having a devil of a time figuring out what the search predicate would be.

    Read the article

1