Forums

Topic: Petit Computer

Posts 7,681 to 7,700 of 9,618

TAINT_Zzyex

UltraWolf2X wrote:

@IAmAPerson You didn't put me in the credits... (I mean at the last part "And all of the people of NintendoLife") Can you put me in the next update?

We are in the credits?!?

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

X:

Discostew

twinArmageddons wrote:

GraphicGenius wrote:

Is it possible to tell if a number is odd or even? It's all I need for my game right now.

untested but try this
IF X/2==FLOOR(X/2) THEN EVEN=TRUE ELSE EVEN=FALSE

EVEN=!(X AND 1)
or
ODD=X AND 1

Discostew

Switch Friend Code: SW-6473-2521-3817

InsertPi

@TAINT_Zzyex I'm very ashamed of you...

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.

X:

InsertPi

TAINT_Zzyex wrote:

IAmAPerson wrote:

@TAINT_Zzyex I'm very ashamed of you...

Wut? Why?

You never watched the credits.

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.

X:

TAINT_Zzyex

IAmAPerson wrote:

TAINT_Zzyex wrote:

IAmAPerson wrote:

@TAINT_Zzyex I'm very ashamed of you...

Wut? Why?

You never watched the credits.

I have a feeling the 5 beutiful letters that form my name just got deleted.

EDIT: gods! I wasn't included to start with! :.(

[Edited by TAINT_Zzyex]

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

X:

Pixelrobin

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)

SORT 0,4,TGEN
GCIRCLE X,Y,RND(TGEN(0)),6

so umm yea...

Everybody do a chirp. CHIRP.

randomous

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:

R=RND(96)
X=R+RND(256-R*2)
Y=R+RND(192-R*2)
GCIRCLE X,Y,R

[Edited by randomous]

randomous

Pixelrobin

@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!

Everybody do a chirp. CHIRP.

randomous

@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.

[Edited by randomous]

randomous

Pixelrobin

@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.

EDIT: Whoops i meant
y=tan(x)·10+sin(x)

[Edited by Pixelrobin]

Everybody do a chirp. CHIRP.

TAINT_Zzyex

X=K×Y or Y=K÷xThis is always fun!

[Edited by TAINT_Zzyex]

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

X:

GraphicGenius

UGGGGHHHHHH
I put in this and it gives me a syntax error:

IF SPHITSP(0,1)==FALSE THEN GOTO @HALT

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?

Slayer

GraphicGenius wrote:

UGGGGHHHHHH
I put in this and it gives me a syntax error:

IF SPHITSP(0,1)==FALSE THEN GOTO @HALT

Later in the code I put down @HALT
What's wrong with it?

Try declaring the loop before using it in there. That might work.
Something like this:

@HALT

Your definition of the loop

Then do this:

IF SPHITSP(0,1)==FALSE THEN GOTO @HALT

[Edited by Slayer]

I have nothing really to say about myself.

ShadowGame

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

Pixelrobin

@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.

Everybody do a chirp. CHIRP.

Discostew

0Games wrote:

GraphicGenius wrote:

UGGGGHHHHHH
I put in this and it gives me a syntax error:

IF SPHITSP(0,1)==FALSE THEN GOTO @HALT

Later in the code I put down @HALT
What's wrong with it?

Try declaring the loop before using it in there. That might work.
Something like this:

@HALT

Your definition of the loop

Then do this:

IF SPHITSP(0,1)==FALSE THEN GOTO @HALT

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.

[Edited by Discostew]

Discostew

Switch Friend Code: SW-6473-2521-3817

banmeihack

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!!

banmeihack

Discostew

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.

[Edited by Discostew]

Discostew

Switch Friend Code: SW-6473-2521-3817

randomous

@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.

[Edited by randomous]

randomous

Sorry, this topic has been locked.