Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 227 228 [229] 230 231 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 907096 times)

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3420 on: November 08, 2012, 10:42:26 am »

Remember: They are a language feature, and all features have a reason to exist, as long as you understand what you are doing. Try to limit use to constants that will be used all throughout the program.

Dutchling

  • Bay Watcher
  • Ridin' with Biden
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3421 on: November 08, 2012, 10:58:07 am »

I just accidentally made a local function.
It seems like I can just do the same thing I wanted to do with a global variable, except instead of making the local variable global, I'll just make the function local.
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3422 on: November 08, 2012, 11:00:29 am »

Game window is now dynamically resizable, and everything still works perfectly. Yay foresight!

Edit: By the way, I do kinda run on feedback  :P
« Last Edit: November 08, 2012, 11:13:48 am by MagmaMcFry »
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3423 on: November 08, 2012, 11:35:47 am »

you also release too often for me to keep up
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3424 on: November 08, 2012, 11:40:43 am »

Edit: By the way, I do kinda run on feedback  :P

I was away for show and tell. What are you doing?

olemars

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3425 on: November 08, 2012, 11:50:02 am »

Game window is now dynamically resizable, and everything still works perfectly. Yay foresight!

Edit: By the way, I do kinda run on feedback  :P

You should consider making a thread for it in Creative Projects,
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3426 on: November 08, 2012, 11:56:58 am »

Game window is now dynamically resizable, and everything still works perfectly. Yay foresight!

Edit: By the way, I do kinda run on feedback  :P

You should consider making a thread for it in Creative Projects,
Lemme just finish the editor first :P

I was away for show and tell. What are you doing?
This. It's a game.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3427 on: November 08, 2012, 01:21:14 pm »

Well, managed to jump off and reach the bottom of the world, and trap myself with an elevator. Movement is pretty smooth, and that's important. Wall-jumping/sliding is a little bit iffy, though. Maybe pause for a bit when hitting a wall, before you start sliding?
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

DrKillPatient

  • Bay Watcher
  • The yak falls infinitely
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3428 on: November 08, 2012, 06:17:21 pm »

Does anyone know of resources on ways to store terrain tile definitions (for a roguelike or something similar) in external data files, like DF does? I'm using C++, but I'm more interested in the general method of doing so; I could use examples in any language.
Logged
"Frankly, if you're hanging out with people who tell you to use v.begin() instead of &v[0], you need to rethink your social circle."
    Scott Meyers, Effective STL

I've written bash scripts to make using DF easier under Linux!

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3429 on: November 08, 2012, 11:56:28 pm »

I have a need. A dire need. Does anybody have any good articles that relate to growing a blot. For example, in dwarf fortress the area that a civilization controls starts as a single point, but grows out as a blot. Another example might be Terraria, where ores are found in blot shaped groups. I need to be able to control the size that the blot can cover, as well as the total number of tiles in a blot.

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3430 on: November 09, 2012, 12:19:00 am »

Depends on the size and intended complexity, but it sounds like what you are looking for are fractals.
Logged

Max White

  • Bay Watcher
  • Still not hollowed!
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3431 on: November 09, 2012, 02:11:12 am »

Step 2 of this.
http://www.squidi.net/three/entry.php?id=54

Although I plan to make several vital changes. That implementation has one or two flaws, but the idea is nice! All I need now is the ability to grow out regions.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3432 on: November 09, 2012, 10:50:06 am »

Also, new version! Entity interactions! Also, enemies! Walking thingies that fall off platforms, and walking thingies that don't! If you walk into them, you die. If you land on them, you bounce! Also, the window is now resizable by changing the window size in the options menu and restarting.

Found it completely unplayable this time around. Extremely laggy. Even getting past the opening menu was a pain. And I had some difficulty getting it to even run /at all/, which is odd, since it worked find last time - I had to manually execute it via the command line within a java context.

Not sure entirely what's going on.
Logged

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3433 on: November 09, 2012, 11:01:06 am »

Step 2 of this.
http://www.squidi.net/three/entry.php?id=54

Although I plan to make several vital changes. That implementation has one or two flaws, but the idea is nice! All I need now is the ability to grow out regions.
In which case, I suggest beginning by growing out from the towns in a simple circle. I assume you already have resources and such in the world nailed down. As the circles of influence (just use some fuzzy-logic stuffs for those) envelope valuable resources, begin expanding in a circle from those as well (also assuming said resources would be easily realized and/or exploited; for hidden resources which don't come into play early on, just ignore them until the population realizes their value). These valuable resources include both natural and man-made resources; count any roads with high or valuable traffic (roads connecting towns, roads connecting towns & resources, respectively) as resources in themselves, growing out from them as well. Vary rates of growth based on how valuable any given resources would be.
Logged

Dutchling

  • Bay Watcher
  • Ridin' with Biden
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3434 on: November 09, 2012, 11:09:13 am »

how do I store stuff in a .txt file with python?
I tried this:
Code: [Select]
        score_file = open('highscores.txt', 'w')
        score_file.write(username + score)
        score_file.close()

That didn't work. The file is still empty.

edit: Nevermind, I created an empty highscores.txt earlier in a folder, but as you can see I forgot to make it open said file in the folder. So there was a new highscores.txt created and saved, but not in the folder.
« Last Edit: November 09, 2012, 11:11:46 am by Dutchling »
Logged
Pages: 1 ... 227 228 [229] 230 231 ... 796