DSiWare Forum

Topic: Petit Computer

Showing 1,601 to 1,620 of 9,308

AuthorMessage
Avatar

KAHN

1,601. Posted:

swordx wrote:

trust me on this: I WILL DO GOOD! I'm an 8th grader. No one else in my grade knows how to do this, so I'm almost guaranteed a good grade.

oh, i believe you! i hope you don't mind me asking, and i'm unsure whether or not you answered this before, but what IS your source material? what book are you reading in class?

KAHN

3DS Friend Code: 1032-1301-2772 | Nintendo Network ID: Milkman12

AuthorMessage
Avatar

With_Questions

1,602. Posted:

swordx wrote:

My Zelda-like game now has a fully programmed enemy that can both kill you and be killed by you. You can kill enemies with a sword

how does one go about doing this?

With_Questions

AuthorMessage
Avatar

Kinsale

1,603. Posted:

Does anyone know where I can find the QR code for petit farm?

Who are you running from? (?_?)/
someday there will be a cactus pokemon, that is actually good.
(O vvv O)/ add me if you want to play KI:U, or ACNL, OR Pokemon
I make a lot of typos, so expect many of my posts to be edited

3DS Friend Code: 3866-8031-2017

AuthorMessage
Avatar

swordx

1,604. Posted:

0LD_SK0OL_PUNK wrote:

swordx wrote:

trust me on this: I WILL DO GOOD! I'm an 8th grader. No one else in my grade knows how to do this, so I'm almost guaranteed a good grade.

oh, i believe you! i hope you don't mind me asking, and i'm unsure whether or not you answered this before, but what IS your source material? what book are you reading in class?

Oh it was just some mythology-based book. I've always loved mythology. I think it was The Serpent's Shadow. lol I find it kinda funny. They say I have an 11th grade to college reading level, but I still enjoy the books based on mythology most. You'd think that I'd prefer more mature books.

@With_Questions

It was quite simple. The damaging is simple sprite collision. As for the movement, I did two things. For the first enemy, I made it so that the variables corresponding to the sprite's position would always be trying to be equal to the variables used for the player's position, but only when you moved. This causes it to move towards you whenever you move.

As for the second enemy, I just gave it random movements. However, this is actually the more complex AI. To keep the movements from becoming a jittery mess, I gave it a variable. When this variable was less than or equal to zero, a new direction was assigned through @labels. This also brought the ever-decreasing variable's value to 45, causing it to keep with the movement for a bit.

It's a bit hard to explain. The best thing you can do is just look at the coding once the game is done. It isn't too complex.

swordx

AuthorMessage
Avatar

Moorpheel

1,605. Posted:

Kinsale wrote:

Does anyone know where I can find the QR code for petit farm?

In my site (and other sites too), the link is in my signature,

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

3DS Friend Code: 0173-1330-0080 | Nintendo Network ID: Abgarok

AuthorMessage
Avatar

Kinsale

1,606. Posted:

Morphtroid wrote:

Kinsale wrote:

Does anyone know where I can find the QR code for petit farm?

In my site (and other sites too), the link is in my signature,

Thankyou very much. I have been meaning to give it a try for a while.

Who are you running from? (?_?)/
someday there will be a cactus pokemon, that is actually good.
(O vvv O)/ add me if you want to play KI:U, or ACNL, OR Pokemon
I make a lot of typos, so expect many of my posts to be edited

3DS Friend Code: 3866-8031-2017

AuthorMessage
Avatar

Bluerobin2

1,607. Posted:

bluerobin2 wrote:

does anyone have ptc utilities? If so, can you draw and/or upload your own grps better than on the ds?

I know this is spamming but please answer me!!! Its like everyone just scrolled through it... :)

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Discostew

1,608. Posted:

bluerobin2 wrote:

bluerobin2 wrote:

does anyone have ptc utilities? If so, can you draw and/or upload your own grps better than on the ds?

I know this is spamming but please answer me!!! Its like everyone just scrolled through it... :)

Huh, I thought I had answered that, but I don't see my post. Anyways, using PTCUtilities, it doesn't just allow you to draw GRPs using it, but you can also import image files, and it'll optimize the color palette down to 255 colors (1 color reserved for transparency), so you could basically use whatever drawing program you want.

"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

With_Questions

1,609. Posted:

swordx wrote:

It's a bit hard to explain. The best thing you can do is just look at the coding once the game is done. It isn't too complex.

oh, i think i understand your basic concept, at least. i think my main problem is executing the code! i don't think i understand Sprite Collision D: (that's a cry for help towards the forum)

With_Questions

AuthorMessage
Avatar

Bluerobin2

1,610. Posted:

Discostew wrote:

bluerobin2 wrote:

bluerobin2 wrote:

does anyone have ptc utilities? If so, can you draw and/or upload your own grps better than on the ds?

I know this is spamming but please answer me!!! Its like everyone just scrolled through it... :)

Huh, I thought I had answered that, but I don't see my post. Anyways, using PTCUtilities, it doesn't just allow you to draw GRPs using it, but you can also import image files, and it'll optimize the color palette down to 255 colors (1 color reserved for transparency), so you could basically use whatever drawing program you want.

cool thanks :D

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

swordx

1,611. Posted:

With_Questions wrote:

swordx wrote:

It's a bit hard to explain. The best thing you can do is just look at the coding once the game is done. It isn't too complex.

oh, i think i understand your basic concept, at least. i think my main problem is executing the code! i don't think i understand Sprite Collision D: (that's a cry for help towards the forum)

For a while, I didn't either. Here's an example of it:

IF SPHITSP(0,1)==TRUE THEN GOSUB @DAMAGE

swordx

AuthorMessage
Avatar

With_Questions

1,612. Posted:

oh, i think i see. i didnt know SPHITSP was supposed to be used in an IF-THEN statement! so once you GOSUB to @DAMAGE, that's where you make the enemy disappear from damage, right?

With_Questions

AuthorMessage
Avatar

swordx

1,613. Posted:

With_Questions wrote:

oh, i think i see. i didnt know SPHITSP was supposed to be used in an IF-THEN statement! so once you GOSUB to @DAMAGE, that's where you make the enemy disappear from damage, right?

It was just an example, but that's about right. I think @DAMAGE means the player gets damaged in my game, because sprite 0 (player) and sprite 1 (enemy) collided.

swordx

AuthorMessage
Avatar

With_Questions

1,614. Posted:

swordx wrote:

With_Questions wrote:

oh, i think i see. i didnt know SPHITSP was supposed to be used in an IF-THEN statement! so once you GOSUB to @DAMAGE, that's where you make the enemy disappear from damage, right?

It was just an example, but that's about right. I think @DAMAGE means the player gets damaged in my game, because sprite 0 (player) and sprite 1 (enemy) collided.

i've tried using this example after establishing two sprites on the screen, but i can't seem to make the enemy disappear. i can move around freely, so the only problem is not being able to do anything with collision. when i GOSUB to @DAMAGE, i make the enemy disappear with SPCLR, then return. so, when i collide with the sprite, it should disappear, right? well instead of that, it disappears at the beginning of the program! i'm not sure what else to do now.

With_Questions

AuthorMessage
Avatar

Credible

1,615. Posted:

well instead of that, it disappears at the beginning of the program! i'm not sure what else to do now.

That's probably because you have SPCLR in your main loop. Put it somewhere else and have a gosub go to it and return, only if the sprites collide.

Credible

AuthorMessage
Avatar

ramstrong

1,616. Posted:

Credible wrote:

well instead of that, it disappears at the beginning of the program! i'm not sure what else to do now.

That's probably because you have SPCLR in your main loop. Put it somewhere else and have a gosub go to it and return, only if the sprites collide.

It's best if you just hide it away, instead of clearing it. Didn't we solve this issue last week?

If you're stuck, try to post the shortest relevant code that still shows the issue. Don't post code snippet since the bug may be somewhere else. Post the shortest working code strictly to show the issue.

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

Bluerobin2

1,617. Posted:

Wow! I just found out you can things like this:
IF A==0 THEN IF B==5 THEN... ETC
I'm sure that not many others thought of that..
Anyways, here is my question; how do you use AND, OR, etc in IF...THEN... statments?

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Moorpheel

1,618. Posted:

Those are called nested comparisons, you could also use AND for the same effect:

IF A==0 AND B==5 THEN Do something.

Of course, if you also want to do something else along with IF B==5 then a better way woud be...

IF A==0 THEN Do Something:GOSUB @CONT

@CONT
IF B==5 THEN dosomethingelse
RETURN

You should remember that you can only have 100 characters in a line of code, and IF in this language is not multi-line so you must do everything on the same line. You can however use GOSUB to create longer IFs.

About OR, it's used in the same way as AND, but the effect is different. It shouldn't be hard to figure out why though.

Edited on by Moorpheel

Moo

Oh look! A Morphloggery.
Oh! eShop Gurus.

3DS Friend Code: 0173-1330-0080 | Nintendo Network ID: Abgarok

AuthorMessage
Avatar

Bluerobin2

1,619. Posted:

Morphtroid wrote:

Those are called nested comparisons, you could also use AND for the same effect:

IF A==0 AND B==5 THEN Do something.

Of course, if you also want to do something else along with IF B==5 then a better way woud be...

IF A==0 THEN Do Something:GOSUB @CONT

@CONT
IF B==5 THEN dosomethingelse
RETURN

You should remember that you can only have 100 characters in a line of code, and IF in this language is not multi-line so you must do everything on the same line. You can however use GOSUB to create longer IFs.

About OR, it's used in the same way as AND, but the effect is different. It shouldn't be hard to figure out why though.

Wow thanks! :). Another random question though, can you only load the font part of an SPU?

Houston, We have a Syntax Error.

Blog: bluerobin2.blogspot.com
Backloggery: backloggery.com/bluerobin2

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

petiSnail

1,620. Posted:

bluerobin2 wrote:

Wow! I just found out you can things like this:
IF A==0 THEN IF B==5 THEN... ETC
I'm sure that not many others thought of that..
Anyways, here is my question; how do you use AND, OR, etc in IF...THEN... statments?

Here's another way to do an if-then block statement. It involves only a single jump so it is more efficient (faster) than a gosub if-then:

lets say you want to do this:
IF A==3 OR A > 5 THEN
[block]
...
[/block]

take the opposite of all parts of the condition:
IF A!=3 AND A <=5 THEN GOTO @SKIP

code goes here

@SKIP

Its a little weird, but its faster (use only when speed matters).

petiSnail