Aluthreney

Members

118

275 Neutral

• Rank
Member
1. Alternative to Implementing Character Class as Singleton

Thanks for the responses. I've decided to keep it simple and implement the player character as a simple class.
2. Alternative to Implementing Character Class as Singleton

I am implementing the player character of my game as a class, and I only need one instance. I want the code to reflect this "single instance" requirement by allowing only one instance to be made. I'm currently looking into the Singleton pattern; it seems to satisfy my requirements of only one instance, as well as limiting access to the player character data, given the scope in which I would instantiate the class. With that said, there seems to be a substantial debate over the use of the Singleton pattern. So, my question: Is it appropriate to use the Singleton pattern to implement my player character class (of which I only need one instance)? If not, are there any alternatives which meet my requirement for a single instance and limited access to the player character data?
3. Inverse Proportion and Zero

That's exactly what I needed, thank you very much. Just one more question: Could you point me to a source of information that discusses the formula you posted? I don't mean to bother, but I always like to have a conceptual understanding of the things I work with.   Once again, thank you very much.
4. Inverse Proportion and Zero

I am sorry if I was unclear; I was trying to get to the point quickly. I am trying to create an user interface where, in order to pick a color, the user must click within the area of a circle. Absolute red (255) lies at 90º; Absolute green at 210º; Absolute blue 330º. When the user clicks within the circle's area, the distance between the clicked point and each absolute color node is calculated. Finally, in order to obtain the each color's intensity, I calculate the distances with the circle's diameter.   I am having trouble with that last part (calculating the color's intensity).
5. Inverse Proportion and Zero

For a few days now, I have been trying to find a way in which I can calculate the intensity of each component of an RGB color based on two lengths. To exemplify: Let us say I am trying to measure the Red component of a color. The minimum length is 0 (which represents 255); the maximum length is 10 (which represents 0); the length I wish to measure is 10.   In so far, I have attempted to use the inverse proportion formula, but apparently it does not work well with zeros: 5/10 = 127.5/x (=) 10/5 = 127.5/x <- Inverse (=) x = 5 * 127.5/10 (=) x = 637.5/10 (=) x = 63.75 The, logically, correct answer is 0. I have been looking for an alternative, but so far I have found nothing. I would be very thankful if someone could point out a formula I could use to calculate the color intensity.
6. A Short Interview for Programmers for a School Research Paper

@TheComet - Thank you very much for your answers; I really appreciate your participation.   More responses are still welcome!

8. Python and online games

Quick question: I'm learning python with the intention of playing around with pygame in the near future. I understand that python can be used in website development, but can I build a game with python (along side pygame) and place it on a website in a similar fashion to flash games?
9. Wishful Writing

I really appreciate the advice and I will keep it in mind for future reference, but this was not originally meant to be a plot for a video game. What I wrote in the OP was just something that I had thought up and felt like sharing with everyone here. I admit that posting it in a creative writing section of a game development forum wasn't the clearest way to get my point across, but such is are the unbeknownst inner workings of my mind, and my actions have clearly brought me excellent rewards. In any case, I gladly welcome all criticism and advice.   If it's not too much trouble, could you point out what those grammatical errors are? You don't have to be explicitly specific if it's too much of a bother.   - Aluthren(ey)(ite)

11. Need help with multidimentional array calculations

I'm working on recreating the renowned Game of Life simulation and I'm currently having some problems with my math. To get to the point, I'm trying to calculate the column and row of a specific element within the array knowing only the size of the array as well as the last element of the array. Let me explain by listing the information:   Index e - element in the array x - column where e is situated y - row where e is situated X - Size of the array (columns) Y - Size of the array (rows)   e = (y*X)+x <--- equation for finding an element knowing the column and row. x = e-(y*X)  <--- equation for finding the column of an element knowing the element and the row. y = (e*x)/X  <--- equation for finding the row of an element knowing the element and the column.   The array I'm working with is 8x6.   So I'm trying to find an algebraic expression that will allow me to find the column of element 9 knowing only the dimetions of the array and that the last element is 47.   P.S. If you have an answer I'd prefer if you'd point me in the right direction instead of saying it directly because I want to figure this out in order to understand it better.
12. Understanting Gravitational Force

out of operators priority, it should be F=G((M*m)/d^2) Newton theory is good for a capiptal absolute moment in universe, and fits well linear space, but count time in, and you will need super small timestep to update linear vectors as often as possible (still a theory, some believe in a linear time quantum). Einstein theory fits time better, yet newton is sufficient usualy with resolution of 0.1 second! But forget simulating two base balls of sun mass one meter from eachother. You cannot express such a small number to step in time to have them not on oposite side of universe, they will accelerate towards eachother toooooooo much, like speed of light * speed of light. Funny   Since my plan is to produce a simulation, could you give me some pointers as to where I should look for further information on what you just explained.   P.S. I'm usually not a nitpicker, but, for future reference, try to be more careful with the way you structure your sentences because I had a hard time understanding what you were trying to say. Having said that, I don't know if english is your first language and I apologize if I offend you with this; it is not my intention.
13. Understanting Gravitational Force

Thanks for the help everyone :D
14. Understanting Gravitational Force

*gasp* You're right! Thank you. Aside from that, does everything else look ok?
15. Understanting Gravitational Force

I'm trying to figure out how to properly calculate the gravitational force between two celestial objects:   Example   Mass01 = 5.97e24 (kg) Mass02 = 1.99e30 (kg)   Distance = 1.50e11 (m)   Gconst = 6.67e-11   So the formula for calculating gravitational force is: F=G(M*m/d^2) This is how I calculated:   Note: Red represents the calculation I did on that step. F=6.67e-11(5.97e24*1.99e30/1.50e11) (=) F=6.67e-11(11.88e54/1.50e11) (=) F=6.67e-11(7.92e43)   (=) F=5.283e33 (rounded)   Did I calculate this improperly or am I being paranoid?