Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 220 221 [222] 223 224 ... 796

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

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3315 on: October 30, 2012, 12:20:56 pm »

Several of us are making a game. :P So that's a bit of a silly question.
Logged

mendonca

  • Bay Watcher
  • [CLIVE]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3316 on: October 30, 2012, 12:43:05 pm »

Posting to watch. Anyone up for making a game?

Realistic ball physics, ASCII display, golf-club battles with alligators (each swing costs a shot) - all because you made a pact with the Devil and ended up in:

GolfLike - the 19th Circle of hell.

(Anyone with me? I've got the rotating sphere aerodynamics equations all ready to go ...)
Logged

TSTwizby

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3317 on: October 30, 2012, 08:04:00 pm »

Quick question- fiddling around with pygame, trying to make various kinds of sprite effects. Want to be able to blit onto a sprite in such a way that only colors, not colors and alpha values are affected (for example, turning a character on fire red). Tried various things with fill and blit using the various special flags, but all seemed to completely ignore the alpha of the thing I'm bliting to.
Logged
I got a female and male dragon on my embark. I got cagetraps on the exits but im struggling to find a way to make them path into it.
Live bait.
3 dwarfs out of 7 dead so far

Kirbypowered

  • Bay Watcher
  • Proficient Dabbler
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3318 on: October 30, 2012, 09:11:20 pm »

Also question: I've been trying to learn C++ for the longest time now, but I find myself incapable of getting an IDE to work. Thought I had Eclipse figured out awhile ago, but it still failed when attempting to execute the code. Recently gave a lazy attempt to use Code::Blocks (and I'm currently trying again), but it's been to no avail.

I don't know where the question is in all that, but if anyone's interested in listening further and helping me out I'd appreciate it. I've spent a little time using an online IDE just to learn some basics, but I'd much rather continue through not-online means.
Logged
THE WINTER MEN COME DOWN THE VALLEY AND KILL KILL KILL.
I'm voting for the Plaid Acre up next on COLORS AND MEASUREMENTS weekly.

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3319 on: October 30, 2012, 09:54:24 pm »

Also question: I've been trying to learn C++ for the longest time now, but I find myself incapable of getting an IDE to work. Thought I had Eclipse figured out awhile ago, but it still failed when attempting to execute the code. Recently gave a lazy attempt to use Code::Blocks (and I'm currently trying again), but it's been to no avail.

I don't know where the question is in all that, but if anyone's interested in listening further and helping me out I'd appreciate it. I've spent a little time using an online IDE just to learn some basics, but I'd much rather continue through not-online means.

Like I stated before in regards to IDEs: they're not necessary for smaller things. Get yourself a lightweight text editor (like Notepad++ or Geany) for writing code and Cygwin for compiling.

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3320 on: October 30, 2012, 10:02:41 pm »

Also question: I've been trying to learn C++ for the longest time now, but I find myself incapable of getting an IDE to work. Thought I had Eclipse figured out awhile ago, but it still failed when attempting to execute the code. Recently gave a lazy attempt to use Code::Blocks (and I'm currently trying again), but it's been to no avail.

I don't know where the question is in all that, but if anyone's interested in listening further and helping me out I'd appreciate it. I've spent a little time using an online IDE just to learn some basics, but I'd much rather continue through not-online means.

If you're on Windows, Code::Blocks and MinGW work well together from my experience.

It's been a while since I set up Code::Blocks, but hopefully these guidelines can help:
- Make sure in Code::Blocks you have set up the compiler by going to Settings --> Compiler (and debugger), with GNU GCC Compiler selected (should be the top one), then in Toolchain executables set the path at the top to where MinGW is located. Should be something like C:\MinGW\bin. Inside of bin should be where mingw32-gcc.exe and other .exe files are at.
- Create a new project, add a new file with a .cpp extension, make a hello world program, build, run.
- Make sure the project's compiler is set to GNU GCC as in the compiler settings menu earlier.


Also question: I've been trying to learn C++ for the longest time now, but I find myself incapable of getting an IDE to work. Thought I had Eclipse figured out awhile ago, but it still failed when attempting to execute the code. Recently gave a lazy attempt to use Code::Blocks (and I'm currently trying again), but it's been to no avail.

I don't know where the question is in all that, but if anyone's interested in listening further and helping me out I'd appreciate it. I've spent a little time using an online IDE just to learn some basics, but I'd much rather continue through not-online means.

Like I stated before in regards to IDEs: they're not necessary for smaller things. Get yourself a lightweight text editor (like Notepad++ or Geany) for writing code and Cygwin for compiling.

I remember I started to learn how to make C# programs without an IDE, using the command line. It was hell. I installed MonoDevelop and it made my life infinitely easier.

I couldn't imagine programming C++ without code completion, (good) debugging, easily linking libraries, and all of the other features of Code::Blocks. I can type "main" and press Alt+A, and it autocompletes the main function, and stuff like that.
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3321 on: October 30, 2012, 10:05:14 pm »

Notepad++ has static code completion, paren matching, and other basic type-savers, at least.
Logged

Kirbypowered

  • Bay Watcher
  • Proficient Dabbler
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3322 on: October 30, 2012, 10:25:49 pm »

Well now I'm feeling stupid. Just moved the projects folder into documents instead of program files (doesn't like me doing things with files there apparently), followed what dreadmullet detailed, and it ran fine. Don't really know what was up with Eclipse, but oh well.

I'll see about trying something like Notepad++ though. Many options and configurations in IDEs are completely above my level of understanding and tend to make me more confused with what I'm doing than otherwise.

Thanks for all the suggestions, guys. I sort of expected to get half a response from someone, if anything at all, so it's nice to see multiple people giving advice.
Logged
THE WINTER MEN COME DOWN THE VALLEY AND KILL KILL KILL.
I'm voting for the Plaid Acre up next on COLORS AND MEASUREMENTS weekly.

TSTwizby

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3323 on: October 30, 2012, 11:51:41 pm »

It might be just me, but it always seems like people here are more interested in being helpful than people on actual programming forums. Whenever I post a question on one of those I'll get like two responses, one asking me if I've tried to do something which I pointed out in my original post hadn't worked, and one using excessive jargon which they say I should have to understand before trying to do anything with [insert programming language]. Unless it's someone linking to a thread which has the same question as mine, only from four years ago, which never got any responses either.

I found a partial solution to my earlier problem, but it only works if I'm using a colorkey for transparency rather than actual alpha values. If possible, I would like to do it with alpha-valued sprites as well.

Also, one more question. When it comes to animated sprites, is there any advantage in setting up a manager class to assign each sprite to its proper frame, or is it not worth the hassle?
Logged
I got a female and male dragon on my embark. I got cagetraps on the exits but im struggling to find a way to make them path into it.
Live bait.
3 dwarfs out of 7 dead so far

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3324 on: October 30, 2012, 11:57:22 pm »

It might be just me, but it always seems like people here are more interested in being helpful than people on actual programming forums. Whenever I post a question on one of those I'll get like two responses, one asking me if I've tried to do something which I pointed out in my original post hadn't worked, and one using excessive jargon which they say I should have to understand before trying to do anything with [insert programming language]. Unless it's someone linking to a thread which has the same question as mine, only from four years ago, which never got any responses either.

I found a partial solution to my earlier problem, but it only works if I'm using a colorkey for transparency rather than actual alpha values. If possible, I would like to do it with alpha-valued sprites as well.

Also, one more question. When it comes to animated sprites, is there any advantage in setting up a manager class to assign each sprite to its proper frame, or is it not worth the hassle?

Glad we could be of assistance. In response to your question, that's how I'd do it, but it's more of a personal design choice in my opinion.

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3325 on: October 30, 2012, 11:58:54 pm »

That really depends on what sort of design structure your taking with this project, obviously.

I'm using the sprite object to handle frames, myself, and sprite objects belong to "characters". My "tiles" are also animated, and belong to squares. My map class manages both squares and characters, and whenever they do what they do, they make sure to pass the message along to sprites as well.

So the sprite stuff really happens with any direct involvement from the manager class, which is, I think, a good thing for something like this. Manage your objects, and have your objects pass needed info to the sprites, and have the sprites take care of themselves.
Logged

TSTwizby

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3326 on: October 31, 2012, 12:23:34 am »

At the moment what I'm doing is having no real 'sprite' class as it seems to be redundant to surfaces as I'm currently implementing them. I have maps which are not tile based and are handled separately from anything else, seeing as there will only ever be one on screen at a time. I then have a generic 'map object' class which has a subclass, 'animate' consisting of animations. My two options are to either handle all the animation stuff within the 'animate' class (which involves storing a dictionary of animations and associated names, with an animation in this case consisting of an array of frames and a flag to say what the sprite does next, whether pausing or playing a different animation) or to make an 'animate manager' class, or something if that sort, which would do basically the same thing, but mean that I only need one big list of animations which I could 'send' to the animates at the appropriate times. I'm leaning towards the first option as of now, mostly because I don't think that what I'm doing will require many of the same animate to be on the screen at once. But I'm not sure how great of a toll that each option would take on memory/efficiency even under ideal conditions.

The reason for the 'map object' class is basically to keep things which aren't animated simpler and to apply effects, like flickering and stuff.
Logged
I got a female and male dragon on my embark. I got cagetraps on the exits but im struggling to find a way to make them path into it.
Live bait.
3 dwarfs out of 7 dead so far

Dutchling

  • Bay Watcher
  • Ridin' with Biden
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3327 on: October 31, 2012, 06:56:48 am »

When I do this:
Code: [Select]
def make_profile(dataset,codons):
    DNA_strings = make_matrix(dataset)
    profile = []
    for number_of_string in range(len(DNA_strings)):
        for i in codons:
            profile.append = 'string'
It gives me an error stating that profile is read-only.
I have no idea why it would be read-only.
Codons is a list of four one-char strings and DNA_strings becomes a list of longer strings btw. Not sure if that is relevant.
« Last Edit: October 31, 2012, 07:12:35 am by Dutchling »
Logged

mendonca

  • Bay Watcher
  • [CLIVE]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3328 on: October 31, 2012, 07:04:14 am »

It's not something related to

Code: [Select]
profile.append('lol')
is it?
Logged

GlyphGryph

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3329 on: October 31, 2012, 07:07:16 am »

0 is falsey?

Why, javascript. Why would you do this to me. Welp, time to completely reorganize my project.

Edit:
Hah! Nevermind! I knew setting up global dictionaries to handle nearly every instance of representative numerical argument passing would come in handy!

I just need to have the dictionaries start counting at one instead of zero, and... Hah!
« Last Edit: October 31, 2012, 07:09:44 am by GlyphGryph »
Logged
Pages: 1 ... 220 221 [222] 223 224 ... 796