Re: small 2D shooter with some impressive effects
Posted: Wed Apr 24, 2013 6:16 am
Anyone have source to this (sorry for such old bump), but the source link is dead and it may have some info I need for a current project.
http://www.purebasic.com
https://www.purebasic.fr/english/
Here's a temporary link to it. I'll modify this message in 2 weeks and remove the link. Get it while you can.Blankname wrote:Anyone have source to this (sorry for such old bump), but the source link is dead and it may have some info I need for a current project.
Very nice thanks! has more info that I am learning from than I expected.Demivec wrote:Blankname wrote:Anyone have source to this (sorry for such old bump), but the source link is dead and it may have some info I need for a current project./quote]
Here's a temporary link to it. I'll modify this message in 2 weeks and remove the link. Get it while you can.
Code: Select all
particle.move(0.5, 1.8)
Code: Select all
ParticleOperations.move(particle, 0.5, 1.8)
With Prototypes in your Structures, you get methodsmp303 wrote:As I have argued in the past, you have objects in PB: Structures are essentially objects without methods. My view on that has not changed.
~
Or is there perhaps already an equivalent feature in PB by now that I missed?
Exactly.mp303 wrote:Our worlds, then, are not really very different from each other at all. We both have to manage the state of variables and records. We both practice separation of state from functionality.
Yep, I'm betting that you have to have a computer "science" degree, right?Now, before flames start coming out of your eyes again, let's get our terminology straight here
PB relies on mutable state, in the form of mutable variables. By definition, that makes it an imperative language - an altogether different family of languages from functional languages.
Most object oriented languages are imperative, so PureBasic belongs to the same family as most mainstream OO languages - and not to the family of pure functional languages. PureBasic may be "pure something", but purely functional, it is not.
As stated that's a bad assumption. Let me assure you that I don't.To summarize: in OO land, we use model-classes, in PB land we use records (Structures).
My degree is not in computer science either, but in general, I don't apply OO techniques where speed is of concern. But, with Prototypes in Structures, you can create a tightly packaged object without much overhead(No Interfaces/DataSection VTables/AllocateMemory/FreeMemory) and still carry a high degree of readability. Moreso than "flat function" calls. I don't see the worry of the extra pointers to manage and referencing them later when/if multiple copies of the object/structure are deployed. Certainly, a heavy structure(contains prototypes) can be abused if you are constantly creating objects within a tight loop just to access 1 or 2 functions/methods from that object.mp303 wrote:With regards to Prototypes in Structures - isn't there a (small) performance penalty for using that, as opposed to flat functions?
Even if there isn't, there is still a penalty in terms of complexity in the source-code, since this forces you to explicitly declare all types of methods, and manually apply them to structures. The result effectively would be the equivalent of a method-table, wouldn't it?
Please review my notes regarding syntactic sugar for function-calls described above - I believe this is further from OO than what you're proposing, and closer to procedural in terms of performance?
And certainly a lot more intuitive to read and write. Even if your primary concern is performance, as explained, this doesn't hurt (run-time) performance and should only slightly impact compiler performance.
Okay, look.em_uk wrote:mp303 - what is your point?
If you don't like PB, log out of the forums and go somewhere else. This ridiculous debate is basically on the edge of trolling people.
We like PB here and find it capable of producing any number of apps/games. I'm not a VB fan, but do I go to a VB forum and start a sanctimonious debate about why they shouldn't be using it? No, because I have better things to do.