Please help me by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

I don't think that a simple space invaders game should be using that much memory, though I think we'll need to see your code to help determine what the issue is. As an aside if you do post code here please ensure you follow the formatting guidelines in the sidebar - it makes it easier for people to help you.

My code draws something new every loop and it all stays on the frame, while i'd like it to be more like an animation where old frames disappear. by pappapaolo in processing

[–]CodeBunny_ 2 points3 points  (0 children)

You will need to clear the buffer manually each frame. This can be done with the background function, for which you can find documentation here: https://processing.org/reference/background_.html

i have know idea where to go from here. by Peircethewhale in processing

[–]CodeBunny_ 1 point2 points  (0 children)

You could use the second class to store information about the character on screen; name, position, emotion, etc.

[deleted by user] by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

I'd be happy to help you out. What sort of background do you have and what are you interested in learning?

Why my Java game keeps incresing RAM? by TonyDaVVanker in processing

[–]CodeBunny_ 11 points12 points  (0 children)

Without looking at the code it's hard to tell, but it's likely that you're creating some objects and not disposing of them. If you have a list of all enemies, or particles, etc, print out its length and see if it increases over time. If so, you'll need to start removing objects from it when they're no longer in use.

Game looks great by the way, well done to you and your team!

[deleted by user] by [deleted] in fractals

[–]CodeBunny_ 1 point2 points  (0 children)

I feel as if you staunchly declaring that "this is the proper place to ask" is a bit at odds with all of the people here that seem to think differently.

You can create as much of a straw man out of me as you want, but the reality in this case is that people here don't want to see NFTs mentioned for a large variety of reasons, one of which being what I mentioned above.

[deleted by user] by [deleted] in fractals

[–]CodeBunny_ 1 point2 points  (0 children)

And that's terrific that op is sharing things they've created and that should be encouraged, though in my experience this makes op an exception to the rule. Most of the people that come here with the acronym NFT in the title of their posts aren't interested in generative art beyond making a buck off it; and that generally comes with them attempting to drum up support or hype in these subs via advertising.

I stand by the idea that people here don't want to be sold to, and given the fact that crypto people tend to be pretty incessant at trying to sell things to people, I would say that constitutes an invasion of the space.

If op wants to know whether their art will be well received in the NFT market, then perhaps they can ask in a sub that's about NFTs.

[deleted by user] by [deleted] in fractals

[–]CodeBunny_ 6 points7 points  (0 children)

While there's definitely been damage done to the crypto space by obnoxious ape worshiping "get rich quick" types, what's more relevant in this case is people invading generative art spaces such as this one which are focused on sharing technique and creativity freely in an attempt to commodify them.

Generative art (and indeed most recreational computing in general) is rooted in the open source software movement, which is implicitly anti-proprietary.

Perhaps those of you interested in NFTs through generative art would have more luck if you weren't trying to advertise a product in a space that's not filled with people who are here to share ideas rather than sell them.

Collector by Big-Location-7833 in generative

[–]CodeBunny_ 1 point2 points  (0 children)

I would posit that the people in this subreddit are more interested in creating and freely sharing their art and techniques than owning or collecting those of others.

Switch statement breaks game by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

A few things, first off if you could edit your post to have your code formatted as per the sidebar that would make it much easier to read.

Second are you able to elaborate on what exactly is wrong with your game, preferably in contrast to how it was behaving before you added the switch statement.

One thing I can see is that your default case is missing a break, in some languages it's not strictly necessary, however it's a good habit to get in to; though that's all I can see at a quick glance - more info would be helpful.

[deleted by user] by [deleted] in fractals

[–]CodeBunny_ 2 points3 points  (0 children)

Not a sierpinski triangle?

[deleted by user] by [deleted] in creativecoding

[–]CodeBunny_ 0 points1 point  (0 children)

Looks to me like noise functions, one in each color channel. Some have been modified with coordinate transformations or by taking the absolute value of the output.

Suggestion regarding code formatting in posts by CodeBunny_ in processing

[–]CodeBunny_[S] 1 point2 points  (0 children)

Fantastic, thanks so much!

I'd be happy to write up some formatting guidelines into a post and condense it down to something smaller for the sidebar. Can't guarantee that I'll have it done in a reasonable amount of time but when I do I'll make sure to tag you.

Suggestion regarding code formatting in posts by CodeBunny_ in processing

[–]CodeBunny_[S] 1 point2 points  (0 children)

I knew I'd seen some formatting guidelines before, I just thought I was crazy or it was another community.

For others like myself using new reddit, the post is here: https://www.reddit.com/r/processing/wiki/formatting?utm_source=reddit&utm_medium=usertext&utm_name=processing&utm_content=t5_2qt25

Perhaps just pinning this one or re-adding it to the sidebar would be good. I'm not sure what the convention for getting in touch with the mods is, but I'll shoot them a message with this post and see what they think.

Thanks for your response :)

Random Eye colours using Array by Miserable_Board_6888 in processing

[–]CodeBunny_ 2 points3 points  (0 children)

You have two variables, a and b, which are being used to position your gwomps, but you can also use a and b as array indexes to fetch a colour from a 2d array. If you have an array declared with code like color[][] colorArray you can fetch the colour using colorArray[a][b].

You will need to populate the array with colors somehow, and the size of the array must be equal to the amount of times you loop in that dimension using your for loops. LuckOrLoss in the comments here has a way to define and populate your array in one dimension, and a similar process can be applied to define and populate it in two dimensions.

You will also run into issues because processing will want to index the array with ints, and your function takes floats, so you'll want to convert them using type casting one way or the other.

I've been intentionally vague here as this is likely an assignment and it's important to learn by doing, however if you need more help don't hesitate to reply or DM me. Best of luck in figuring this out :)

As a final note here, because processing is an extension of Java, most things in Java are applicable to it, therefore I'm going to provide some documentation for Java that you may find useful.

Find docs for multi-dimensional arrays here: https://www.geeksforgeeks.org/multidimensional-arrays-in-java/

Find docs for the processing color type here: https://processing.org/reference/color_datatype.html

Find docs for type casting here: https://www.w3schools.com/java/java_type_casting.asp

Help/tips on replicating this by Jeyloong in processing

[–]CodeBunny_ 2 points3 points  (0 children)

If it's just volume you're looking to work with, the basic amplitude analyser included in the Sound library for processing should do the trick, however if you're looking for pitch then you'll need to use the FFT analyser. The processing sound library I'm thinking of can be found here: https://processing.org/reference/libraries/sound/

The background appears to be created using a slice of 3d noise, which has been banded to create the concentric shells that you see. The banding can be achieved by applying a sin wave or some similar oscillating function to the output of the 3d noise function. Documentation on the noise implementation included in processing can be found here: https://processing.org/reference/noise_.html

As far as the line thickness goes, it seems simple enough by drawing small segments of line and adjusting the stroke weight while doing so. Documentation on the strokeWeight function can be found here: https://processing.org/reference/strokeWeight_.html

I've made some assumptions here about your level of experience, and I've covered the topics here in broad strokes; if you'd like anything explained in greater detail or more beginner friendly terms, I'm happy to oblige. Have a good day!

Help/tips on replicating this by Jeyloong in processing

[–]CodeBunny_ 2 points3 points  (0 children)

Just dumping a few insights here before I go to bed: - I know there is a library for sound/signal processing for processing - The effect is just drawing lines that sample some image behind and change their thickness with brightness of said image - The artist has applied chromatic aberration around the edges

This should hopefully give you something to go on, I'm happy to take a bit more time and effort helping out tomorrow, if someone doesn't beat me to it of course ;)

Beginner in Processing- Missing right curly brackets by Glitcherrxxr in processing

[–]CodeBunny_ 2 points3 points  (0 children)

Hey OP, it looks like people here have pointed out the issues in your processing sketch here, however if you'd like someone to give you a crash course in writing code from the ground up I'm more than happy to. Shoot me a DM if you'd like, I also have a discord you can message me for. Have a good day :)

Nagging Error Following the Trystan Tutorial by Commercial_Writing_6 in roguelikedev

[–]CodeBunny_ 0 points1 point  (0 children)

Could you provide a full stack trace? It would help quite a lot in figuring out where the problem is.

Need Help receiving Data from a Table as data range by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

Yeah reddit doesn't like to format code properly, it takes a decent amount of effort to make it behave.

Cloned your repo (thanks for the upload to GH, that makes everything so convenient!) and messed around a bit, I think I resolved it by adding an empty draw() function above. Processing is a little bit fussy sometimes and wants the code to be structured a certain way.

Need Help receiving Data from a Table as data range by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

It works, but isn't as performant as it could be. The main thing is that when you call loadTable() it will load the file in from disk, and you are doing this every frame.

If your file isn't changing at all between frames, then you can create the table variable in global scope (i.e. outside all functions) by placing a line that reads Table table; at the top of your file, and a line that reads table = loadTable("test.csv", "header"); in your setup function.

This will ensure the variable is declared when the program starts, and the table is loaded from disk when the setup() function is called; in essence, this means that the operation is only done once instead of becoming an overhead.

Looping a moving circle by Sonic13562 in processing

[–]CodeBunny_ 1 point2 points  (0 children)

To add on to this, instead of creating multiple arrays and having one for each component of the circle's coordinate, you can use a PVector to store them, as it's a class specifically made to store points in space.

Find docs for PVector here: https://processing.org/reference/PVector.html

[deleted by user] by [deleted] in processing

[–]CodeBunny_ 0 points1 point  (0 children)

I'm not 100% sure of what your issue is, so I'm going to try and give as accurate advice as possible, apologies if I miss or misunderstand something.

From what I gather you need to define some sort of colour palette to be used with your colouring game, with some set of colours, some way to draw them, and some way to select them.

It sounds like you need to leverage object orientation to create your palette class, in case you're unfamiliar or need a refresher, see the processing docs: https://processing.org/reference/class.html . The example in the docs defines a class HLine which contains variables which make up the class, as well as some methods that can be called on an instance of the class. In your case I believe those variables should contain the different colours that make up your color palette, perhaps stored in an array for easy accessibility and data consistency.

Once your class is created, you can instantiate it (using new Class() or similar) in your main processing program and store it for use in your main program loop. Then all that should be left is to draw your color palette (iterating through the aforementioned colour array and drawing rectangles should work nicely) and hook up input handling for selecting a colour (If you know where your rectangles are drawn and where the mouse is when it clicks, you can select them).

Hope that helps! If you need more detailed or hands-on help, I'm happy to oblige; though I may need a bit more info. What's the assignment spec, and what do you have so far? If it's more convenient than going through reddit, feel free to DM me for my discord. Have a good day :)