DSiWare Forum

Topic: Petit Computer

Showing 6,541 to 6,560 of 9,304

AuthorMessage
Avatar

calc84maniac

6,541. Posted:

randomous wrote:

@iprice But it's such a messy solution. I'm still looking for another way, if anybody's got one.

Another approach you can take is to keep track of the total number of sprites, which I'll call N, and only use sprite slots 0 to N-1. Then, whenever you remove a sprite, let's say from slot M, you can move sprite N-1 to slot M and decrease N by 1.

calc84maniac

AuthorMessage
Avatar

InsertPi

6,542. Posted:

@BonChoi hasn't been on in a while...

@mystman12 example? Cause if I'm thinking correctly, you can just do

X$="θ"

Edited on by InsertPi

Main developer and programmer of Minecraft DS!

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter: @PhilLovesPi

AuthorMessage
Avatar

randomous

6,543. Posted:

@calc84maniac Pfft, of course! Goodness, it's always the simple solutions that work the best, isn't it? Thank you.

randomous

AuthorMessage
Avatar

calc84maniac

6,544. Posted:

randomous wrote:

@calc84maniac Pfft, of course! Goodness, it's always the simple solutions that work the best, isn't it? Thank you.

Yeah, the real trick is that you don't care about what order things are in. If order mattered, it would be a bit more complicated.

calc84maniac

AuthorMessage
Avatar

InsertPi

6,545. Posted:

Minecraft DS Beta 1.5.5 will have a fully working inventory! You'll even be able to control what blocks go where in your hotbar! For example, if I wanted TNT in slot 1 on my hotbar, and sand on slot 2, we can now do that! I'll add render distance and the release it! Also, if you have bedrock hacked onto your map, unless you want it to stay, I suggest you move it, cause bedrock is now unbreakable (and unobtainable, but it's easy to hack into your inventory)

Main developer and programmer of Minecraft DS!

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter: @PhilLovesPi

AuthorMessage
Avatar

LeviCelJir

6,546. Posted:

IAmAPerson wrote:

Minecraft DS Beta 1.5.5 will have a fully working inventory! You'll even be able to control what blocks go where in your hotbar! For example, if I wanted TNT in slot 1 on my hotbar, and sand on slot 2, we can now do that! I'll add render distance and the release it! Also, if you have bedrock hacked onto your map, unless you want it to stay, I suggest you move it, cause bedrock is now unbreakable (and unobtainable, but it's easy to hack into your inventory)

Can't we just MCDSedit it out ;)

My 3ds Friend Code: 3625-8498-4946.(Tell Me If You Added Me)---"When Freaky Aliens Give You Lemons, Make Freaky Alien Lemonade."---W2 FC:5115 1708 3491---Currents Projects: Cookie Clicker Petit Computer Edition (http://petitcomputer.wikia.com/wiki/Cookie_Clicker_Petit_Computer_Edition), RAYSCARE

AuthorMessage
Avatar

TAINT_Zzyex

6,547. Posted:

http://petitcomputer.wikia.com/wiki/RPG_Sprites FINAL edition of my rpg sprites. more will come i guess. these are all that i will have in my first game. (ize got movement in) when i have a battle system i will post

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

Twitter: MetricCat

AuthorMessage
Avatar

randomous

6,548. Posted:

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Edited on by randomous

randomous

AuthorMessage
Avatar

calc84maniac

6,549. Posted:

randomous wrote:

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Yeah, SPHIT takes an optional second argument which is the initial ID of the other sprites to check collision with. So to detect multiple collisions, put SPHITNO+1 in that second argument to search after the first detected collision.

calc84maniac

AuthorMessage
Avatar

randomous

6,550. Posted:

@calc84maniac Ahh, so SPHITNO returns the sprite with the lowest ID that is currently colliding with ours... Thank you very much!

randomous

AuthorMessage
Avatar

damolii

6,551. Posted:

TAINT_Zzyex wrote:

http://petitcomputer.wikia.com/wiki/RPG_Sprites FINAL edition of my rpg sprites. more will come i guess. these are all that i will have in my first game. (ize got movement in) when i have a battle system i will post

You could just try and use mine.......

I don't have a 3DS so what do I put here? -Damolii

AuthorMessage
Avatar

InsertPi

6,552. Posted:

I'm working on some techniques for render distance. I'm getting some the somewhat work. I thought I had hit the gold when it didn't show any blocks after 16 blocks, but after playing around with it a bit, it was the glitchiest thing I've ever made, and that's an understatement. Have you ever seen boogie blocks? That was what I had going on. It was a dance fest with the blocks! :D

Main developer and programmer of Minecraft DS!

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter: @PhilLovesPi

AuthorMessage
Avatar

ramstrong

6,553. Posted:

randomous wrote:

The solution I came up with was to use a string to represent which slots were currently open and which were not. It would start out as a string filled with 0's or something. I could then use INSTR to get the first occurrence of a 0, and that position would be the first free position in the array of velocities/etc. I'd then set it to 1. This sort of solves the "linear search" problem, as I've replaced an interpreted linear search with a "native" one.

I know there's a better way to this... but I just can't think of it. Do you guys have any suggestions?

I don't see a better way than that. You can fake linked list with array. You can compress the list while scanning. But for searching list with lots of item manipulations, hashing is the best solution, and for as long as you can search quickly with string, just do it with string. That's what I'd do with C language, anyway. If I were you, I'd probably do the compression thing during idle loop. It's just so easy and simple that way. Assuming the item coming and going isn't so heavy, you probably can get away with just scanning/compressing a few items at a time. It won't be worse than present situation, in any case.

I see calc84maniac has a simple good solution. It does mess up the order. I take it, ordering doesn't matter then? Then I must be misunderstanding your problem. Are you keeping the list for processing "active sprites"? If so, you may want to delete several items at once. If that situation occurs often, then idle compressing would work better. Just set it up as background process during idle loop, so you don't have to worry about it in the main.

calc84maniac wrote:

randomous wrote:

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Yeah, SPHIT takes an optional second argument which is the initial ID of the other sprites to check collision with. So to detect multiple collisions, put SPHITNO+1 in that second argument to search after the first detected collision.

I use SPCOL to separate collisions. But that second argument is useful than just first detecting collision. When you group a certain sprites, say enemies at sprite 50-80, then you can simply do SPHIT(player,50) to check enemy collision directly. You still need to check for range, so if the sprite control number is greater than 80, then you're colliding with something else.

Edited on by ramstrong

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

randomous

6,554. Posted:

@ramstrong If I'm using the data that the sprite can hold, then the order wouldn't matter, because I just need to go through the sprites and update positions and such.

randomous

AuthorMessage
Avatar

ramstrong

6,555. Posted:

randomous wrote:

@ramstrong If I'm using the data that the sprite can hold, then the order wouldn't matter, because I just need to go through the sprites and update positions and such.

It depends on how you structure your program. I like to keep the ordering because it helps with groupings, or hierarchical processing.

Petit Computer Journal
Old site http://ramstrong.blogspot.com

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

GraphicGenius

6,556. Posted:

Sorry I haven't been on the forums lately @Pootrick2 I blame Minecraft (Not saying it's a bad game!) taking up all my time.
Anyways, What should I work on? And @IAmAPerson

HOW DO YOU DO GRAPHICS?!?!

I really need to know the answers to both of these questions to work on the game.

"UGGGHHHHHHHHH I'm such a loser!" -PuppyCat from Cartoon Hangover
That explains my LIFE.

3DS Friend Code: 1478-3545-5136 | Nintendo Network ID: GreatGamer123

AuthorMessage
Avatar

InsertPi

6,557. Posted:

programmerpro wrote:

IAmAPerson HOW DO YOU DO GRAPHICS?!?!

Not too hard. First, we have to set up our screen so that we can draw.

ACLS:CLEAR

This you should already know. If not, ACLS clears ALL the screens of EVERYTHING (except sprites. for that, do SPCLR) and CLEAR clears all the variables

GPAGE 0

This says to draw on the top screen. 1 is bottom screen. 2 and 3 are invisible; those might not seem important, but it's essential to stuff like Minecraft DS

GCOLOR 15

Sets the drawing colour to white. 0 is transparent. Different numbers make different colours.
Now we're ready to draw. (NOTE: The [ ] means that it is not a required field)

GPSET X coord,Y coord[,colour]

Makes a dot at a specific point on the screen

GLINE X start,Y start,X end,Y end[,colour]

Makes a line on the screen

GBOX Top-left X,Top-left Y,Bottom-right X,Bottom-right Y[,colour]

Makes a box on the screen

GCIRCLE X coord,Y coord,radius[,colour]

Makes a circle on the screen

GCLS

Clears JUST the graphics

GFILL Top-left X,Top-left Y,Bottom-right X,Bottom-right Y[,colour]

Makes a section of the screen a specific colour

These are the basics! If you wish for some more, just ask!

Main developer and programmer of Minecraft DS!

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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter: @PhilLovesPi

AuthorMessage
Avatar

Discostew

6,558. Posted:

randomous wrote:

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Someone had asked about sprite collision some pages back, and I explained it, including code for handling collision of multiple sprites with one.

http://www.nintendolife.com/forums/dsiware/petit_computer?sta...

"What fun is there in making sense?"
Lazer Light Studios - Home of the MM2 PTC project

Pokemon 3DS Friend Safari - Ice - Spheal, Sneasel, Lapras

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

AuthorMessage
Avatar

randomous

6,559. Posted:

@Discostew Thanks! @calc84maniac already explained it, but at least now I've got two people backing the same method lol.

It would be nice if the sprite hitbox would follow the angle of SPANGLE. The shots are lines, and I had wanted to make the hitbox a line... but it keeps its orientation when using SPANGLE. Oh well.

randomous

AuthorMessage
Avatar

Slayer

6,560. Posted:

randomous wrote:

@Discostew Thanks! @calc84maniac already explained it, but at least now I've got two people backing the same method lol.

It would be nice if the sprite hitbox would follow the angle of SPANGLE. The shots are lines, and I had wanted to make the hitbox a line... but it keeps its orientation when using SPANGLE. Oh well.

Oh, say does that star-SPANGLEd banner yet wave
O'er the land of the free and the home of the brave?

"When the men ran dry of ammunition, they used their blades. And when the
blades ran dull, they used their hands."
Elias, Call of Duty Ghosts
Accents I know: British
Accents I'm working on: Irish, Scottish