This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - alberthrocks
Pages: 1 ... 39 40 [41] 42 43 ... 55
601
« on: February 01, 2011, 07:01:07 pm »
I am intermediate At python i mainly have used it for pretty simple games. This is my first attempt at a more difficult game. I almost have the basics of the game working right now I need a sprite though and I'm trying to decide what to use. and it wasn't that I didn't know how to do it it was that i wanted to try and find an optimized way of doing it without looping through every single pixel.
Hmm... good point. I'm not too sure how to search through an array without looping through it - a bit of .index(n) use may do it, but so far my tests show it only returns one index, not an array.
602
« on: February 01, 2011, 06:18:30 pm »
Implementing cellular automata is not too hard. You will want to start with two arrays. These arrays will hold the pixels that represent your element you want to simulate, like water. They will both have the length of the ammount of pixels you want to simulate, and one will hold the X value of a pixel, while the other array will hold the Y value for the pixels. After that, you will want to loop through the array, applying your physics to each pixel as you go along. Remember, physics is as simple as a set of rules like I explained in the other thread
Hehe, I had the same thought! I didn't read the tutorial at all - just stared at words briefly and found a nice screenshot. I thought about how you would do it - did you do pixel testing? No, since the water itself is "black". The next idea was an array of pixel colors, but that didn't make any sense either. Finally, 2 different arrays to compare "water pixels" with "obstacle pixels" was my final planned implementation idea... which turned out to be your implementation method too! Were you thinking multidimensional arrays: [0, 1, 2, 3, 4, 5 6, 7, 8] ...or just regular arrays? [0, 1, 2, 3, 4, 5, 6, 7, 8] Could i have an example of some python code for that please. I'm trying to figure out a way to optimize this it would be slow i think if i have to go through most pixels in a nearly if not full screen game.
The only reason i might not do full screen is because i want this to be a very fast game that won't glitch up. i think it would be easier if i had a slightly smaller screen size.
I said above that I will try myself in getting that implemented. Python is pretty powerful at array management. I'm not too sure myself how to attack this, but it might be using a multidimensional array. This can be done with below: a = [[v]*n for x in xrange(n)] ...where v is an int for an initial value, first n is the width, last n is the height. Accessing the values (and of course, assigning them) is even simpler! Simply: a[y][x] = 1 print a[y][x] I still don't believe you are that well versed in Python.... otherwise you would've known about numpy and numarray! Those are both true multidimensional array handlers, and can probably be better (and faster?) than the method described above. NumPy and numarray are out of my scope of knowledge though... and so I'll redirect you to the official manual/tutorial: http://www.scipy.org/Tentative_NumPy_TutorialIf you search "Multi-dimensional arrays: However, numarray does support true multi-dimensinoal arrays" on the page below, there is another perspective on numarray/numpy: http://www.astro.ufl.edu/~warner/prog/python.htmlHope this helps!
603
« on: February 01, 2011, 03:57:24 pm »
I wanted to know how to do the cellular automata. I also need to be able to do good collision detection and gravity.
First off - have you made the concept on your calculator, and does it work? Second, are you well versed with Python and Pygame? Third, can we see some sample code?
I don't get the first one This is a comp program I'm well versed with python and have done all right with pygame I'm still making up the code, but if you want to see some code I'll post it later.
@Builderboy I want to know how to optimize that code and some of the concept
What you want to do is a computer program, but you should immerse yourself with a calculator implementation to really get how it works, then try attempting it in Pygame. I will try sometime this week (if not today) to implement a simple example (much like BuilderBoy's screenshot) in Pygame. I'd still like to see some code to make sure you're on the right track.
604
« on: February 01, 2011, 03:44:03 pm »
I wanted to know how to do the cellular automata. I also need to be able to do good collision detection and gravity.
First off - have you made the concept on your calculator, and does it work? Second, are you well versed with Python and Pygame? Third, can we see some sample code?
605
« on: February 01, 2011, 03:36:27 pm »
I'm using pygame for graphics. I don't really know any of the other ones
EDIT: if it matters I'm using python 2.6.2
The following code will do pixel placement: screen.set_at((x, y), (red, green, blue)) Similarly, you can get a pixel's color too: thecolor = screen.get_at((0,0)) The var screen is defined as: screen = pygame.display.set_mode((width, height)) Pixels values range from 0 to either height - 1, or width - 1. (Like TI-Basic and Axe! ) I'm hoping that you are very fluent in Pygame and the physics concept, because it's a must! I got those snips from http://www.ida.liu.se/~ETE257/timetable/LecturePythonPygame.html and http://lorenzod8n.wordpress.com/2007/12/16/pygame-tutorial-5-pixels/, so you can read over the mini tutorials there if needed.
606
« on: January 29, 2011, 06:32:08 pm »
thepenguin77, is it possible for you to make IPS patches (aka PolyPatch format) from your program based patches? (Both "pi" and hidden menu patches) That would be awesome!
607
« on: January 27, 2011, 05:54:07 pm »
pull a battery kills it. They know that, sadly... :'(
Gah, sorry Do they do it as a joke or to torture you? A friend used to do that as a joke...
608
« on: January 27, 2011, 11:18:26 am »
I've disassembled and converted compiled Axe programs to apps before Axe got application creating support. But that requires a little bit of assembly knowledge, which I'll assume you don't have. ticalc.org has plenty disassemblers - just pick one that fits your needs.
well, i meant that others could decompile my prog and then see all the codes i put in... if that is possible, it is a minus...
Nope, there are no Axe decompilers out there, so the farthest you can go would be to disassemble it into assembly. The Axe source is gone, in other words.
but that is still no clear answer to my question: is it possible to decompile and see the codes?
Ehh... assembly code, yes. But not very interesting (or fun) to read: http://omnimaga.pastebin.com/zCHk31V4
609
« on: January 27, 2011, 11:03:31 am »
I've disassembled and converted compiled Axe programs to apps before Axe got application creating support. But that requires a little bit of assembly knowledge, which I'll assume you don't have. ticalc.org has plenty disassemblers - just pick one that fits your needs.
610
« on: January 24, 2011, 11:18:34 pm »
THIS. IS. AWESOME! This actually might give me a reason to upgrade.... Could you implement the IPS patches for disabling certain buggy features of the OS? I've seen it before (patched OS to disable annoying things in *MP), but lost track of it. EDIT: also, although I think it would work with WINE on Linux, here's a nice list of IPS patchers for multiple platforms that you may want to include with the ZIP: http://www.zophar.net/utilities/patchutil.html
611
« on: January 21, 2011, 11:12:38 pm »
Beautiful and well organized site. I plan on joining as a part time dev (I'm pretty busy ), but not just in calcs - I might be able to help out in web dev too! (I do PHP/MySQL, and have designed a "Dropbox" for a school class for them to use. It's ugly but awesome! )
612
« on: January 20, 2011, 03:54:47 pm »
I agree with going CLI. It's not quite an IDE, just a disassembler. (Besides, the GUI code was a copy and paste from http://www.wellho.net/resources/ex.php4?item=y207/wx03_02.py, which is a big no no. ) On the plus side, CLI does have pluses, including the ability to focus on core stuff! (You should really understand disassembly before writing this utility... ) That said, I've went and beautified and converted it to a library. For those who wish to use it (in the future, it's in a terrible state), simply do: import prizmdisasm # (this may be shorter in the future) # do anything you want to get done here, including data fetching/manipulation prizmdisasm.getG3Adata(datavar) # Only if you use a G3A prizmdisasm.disassemble(asmdata) # Disassemble it!
That's it! As said above, the GUI is removed, so you don't have to worry about wx being installed. P.S. - you guys should combine your efforts (bsl and Scout) and make a unified disassembler! For bsl, I'd advise you to use a dictionary to pull values so that it's easy to modify code, plus making it more organized. EDIT: also, here's the help (and how to get the help): ~$ python prizmdisasm.py -h PRIZM Disassembler v1.0.1 CLI and Library ========================================= Usage: prizmdisasm.py [option(s)] ... [inputfile]
General options: -o, --output=[outfile] Specify output file to write to. Disassembly options: -t, --type=[type] Specify the input file type. Type can be 'hex', 'bin', 'enii', or 'g3a'. -s, --distype=[distype] Specify the disassembly type. Help/About: -h, --help Get help! :) (Shows this help) -w, --webhelp Go to PRIZM hacking site for more info/help! :) -c, --credits Who made this awesome program? :D (This also shows the license of this program.)
613
« on: January 18, 2011, 11:39:48 am »
There's AutoCalc, but it would be nice if it was made in Axe or ASM, for speed. You would need to make sure teachers won't notice, though.
I've tried AutoCalc, but it never works for me unfortunately. solve( also isn't on the CAS, a prime part of a CAS.
614
« on: January 18, 2011, 09:39:15 am »
Very nice! Also, I would be interested in seeing Python and a GUI lib on TI-Nspire too! (Or better yet, Linux if we can do it!)
615
« on: January 17, 2011, 10:21:12 pm »
An on-calc large sprite editor that will automatically split the sprite to 8x8s. An on-computer large sprite editor that will automatically split the sprite to 8x8s. * TI-BASIC parser for the computer, with a virtual screen to see the program run. * * Albert loves you if you make it cross-platform!
Pages: 1 ... 39 40 [41] 42 43 ... 55
|