If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.
Could someone think of a simpler (or shorter) way to do this? Its pretty short but it would be great if it was shorter. (Or maybe I'm over-thinking things).
This is a method I devised to create a circle within the screen range at a random position without having the radius cross the outer screen border. Here it is:
ACLS:CLEAR
X=RND(255)
Y=RND(191)
DIM TGEN(5)
TGEN(0)=ABS(0+X)
TGEN(1)=ABS(0+Y)
TGEN(2)=ABS(255-X)
TGEN(3)=ABS(191-Y)
Well, you don't necessarily need that ABS(0+X) or ABS(0+Y), you could just use X or Y. Other than that, there's nothing wrong with the way you've done it. Of course, you could always generate the radius first, which might make things shorter:
@randomous not exactly what I needed, I wanted the whole circle on screen to be visible. Besides, setting the radius to x or y doesn't give as much randomized generation as I prefer. Thanks for the help anyway!
@Bluerobin2 Oh sorry, I was too hasty in posting and posted the wrong code. Look again lol. Just note that the method I show is weighted towards the center. You can change this, of course, but it's not too noticeable if you're generating lots of circles.
@randomous hey thanks! I'm also thinking of generating off a seed (I can do that), but I want to ask you (or anyone); what is the wackyist 2d graph equation you could think of? I think mine was some thing like: y=tan(x)·10+tan(x)
But I might need to go wackier. Please note that any input value should work.
Later in the code I put down @HALT
What's wrong with it?
If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens. Wait was that just a joke?
Sorry for asking again, but how can i load more sprites per load"spu0:filename",0
then only one? When i try spu1 then it only shes two sprites with the Image i loaded with spu0
@Shadowgame Okay, when you open CHRED and start editing the sprites, notice that there are about 4 rows of 16 sprites. You may edit these sprites and save the entire page. Then ingame, you may load the entire sheet on sheets 0 to 6 (I think). Then you call out sprites from the sheet like you would normally do:
SPSET 0,0,0,0,0,0 would call out the first sprite from the first sheet (This would be a bullet if you didn't load anything)
SPSET 1,1,0,0,0,0 would call the second sprite from the first sheet.
If you wo]ould like to call a sprite from the second sheet, you'll not start with 0 but with the continuous ongoing number.
That isn't the cause. SmileBASIC doesn't require label ordering or anything like C does with functions and prototypes. Labels are inspected before the program executes (which is how it can find duplicate labels and give an error indicating as such).
I tried the code myself, and I am not getting any syntax errors (which are errors related to incorrect spelling of variables, functions, etc...in the case of a BASIC language, it's likely a function or a keyword). You may have typed it wrong in your code, but typed it correctly here. Check them both, and make sure the line number the error occurs on is correct too.
So I have been making a game for a few days and I made a clipping algorithm (I am trying to develop everything from the ground up and am not using sprites) and a whole variety of elements in the game. Now I am getting to the point where my game is beginning to bottleneck and lag because of two key reasons. 1. I am unsure as how to dynamically save an image as a background image and then reload that image each frame, instead of redrawing all of the elements of that image. 2. I am trying to improve my clipping algorithm (currently I am using a baycentric method) using a different method I created. The new method involves creating an array of 0s and 1s which describe the edges of my ship(the unitin the game is a ship) and then referencing this array to determine if the location of a "bullet" or "projectile" exists at a location in which the ship does. This method does not require calculation of whether the point is inside a polygon and could potentially be a ton faster. So I had a few questions to ask: How can I manipulate a character (the 8x8 arrays used for sprites) and modify the values in the arrays within my program (the ship design is randomized and so I need to create these characters each time). Then Is there way to reference some point in the array and figure out its value? Sorry for the wall of text!!
Ever look at particular parts of your code, and realize how large certain parts are? I just looked over my code, and all the AI for all my currently implemented entities is almost 3000 lines of code. Seriously, my AI code is larger than everything else, including level processing, editor, functions related to sprites/tilesets/audio/etc (which the AI code uses)........ all those combined, and is still smaller.
@Discostew Quite terribly, in Village, my largest single function is the Shop. However, most of the code in Village is dedicated to auxiliary functions. For instance, it seems like nearly all my code is in stuff like the dialog box system, the property system, time keeping, etc. The rest is mostly drawing lol.
Hey, I'm sure this is a ridiculously easy problem (or maybe it's one of those ridiculously hard ones, I don't know), but I can't figure out the solution and I'd like some input. I need a way to transform a set of data points into another set by averaging, but the amount of data will be very similar. For instance, I need to match 54 points against 56 points, so I need an algorithmic (and preferably quick) way to morph the 56 points into 54 points. An example of an easy version of this problem would be to match 28 points against 56, in which case I could just average every two points into a single point and I'd be done. However, I don't know how to "average" parts of a point into another. I hope this makes sense... I'm not looking for how to find the average of 56 points, I'm looking for a way to transform 56 points to 54 points (any number, really) by averaging.
Forums
Topic: Petit Computer
Posts 7,681 to 7,700 of 9,618
Sorry, this topic has been locked.