DSiWare Forum

Topic: Petit Computer

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

AuthorMessage
Avatar

Kinsale

1,601. 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,602. 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

Morphbug

1,603. 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,

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

Kinsale

1,604. 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,605. 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... :)

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Discostew

1,606. 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,607. 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,608. 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

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

swordx

1,609. 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,610. 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,611. 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,612. 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,613. 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,614. 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,615. 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?

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Morphbug

1,616. 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 Morphbug

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

Bluerobin2

1,617. 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?

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

petiSnail

1,618. 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

AuthorMessage
Avatar

Hamjam00

1,619. Posted:

I have a new OS in dev called OaSis! it should be done by the 22nd or even sooner. I have personal input from @bigdog00 and it should be a great os! Also, I am currently designing a new logo for my new company, Zombeesoft. (It wont be MS paint this time lol)

Edited on by Hamjam00

Python, C/C++, Lua, Ruby rule (java is too complex lol)

Twitter: zombeesoft

AuthorMessage
Avatar

ChangeV

1,620. Posted:

tiger667 wrote:

Is there any way to make a sprite on the bottom screen using the background characters, specifically a 64X64 white square. I want to make a text window that can be closed with animation to make it more obvious where to touch the screen to get it back, and I made some code to do it on the top screen (though I forgot to save it so I need to redo it), but I can't use the same sprite on the bottom screen so I am hoping I can at least use a background tile as a large sprite.

Here are 3 simple ways to slide text window.
all 3 shows basic idea of using different methds(sprite, BG layer, Graphic layer)

they simply put(and slide) window on top of grass field(which is rear BG layer).
and text output is simply done by PNLSTR command.

press any button to open and close text window.

here is sprite version.
Untitled

ACLS
CLEAR

'turn off bottom panel.
PNLTYPE "OFF"

'make some grass field.
BGPAGE 1
BGFILL 1,0,0,31,23,33,8,0,0

'select lower screen for sprites.
SPPAGE 1

'make 64x32 sprite with white color (&HF).
'sprite bank name for lower screen is "SPS0" and "SPS1".
'64x32 size sprite is 32 blocks of tile.
CHRINIT "SPS0"
FOR I=0 TO 31
CHRSET "SPS0",I,"F"*64
NEXT

'setup 2 big 64x32 sprites.
'set order of priority to the behind of console.
'so text will appear on top of sprites.
SPSET 0,0,0,0,0,1,64,32
SPSET 1,0,0,0,0,1,64,32

'scale 200%
SPSCALE 0,200
SPSCALE 1,200

'put them outside of bottom part of screen.
SPOFS 0, 0,192
SPOFS 1,128,192

@MAINLOOP

'wait for button press
FOR I=0 TO 1:I=BUTTON():NEXT

'move sprites up slowly using interpolation time.
SPOFS 0, 0,128,10
SPOFS 1,128,128,10

'wait until sprite has finished moving.
FOR I=0 TO 1:I=!SPCHK(0):NEXT

'put some text
PNLSTR 1,18,"This is first line.",14
PNLSTR 1,20,"This is second line.",14
PNLSTR 1,22,"This is third line.",14

'wait for button press.
FOR I=0 TO 1:I=BUTTON():NEXT

'erase text with blank
PNLSTR 0,18," "*32,14
PNLSTR 0,20," "*32,14
PNLSTR 0,22," "*32,14

'move sprites down slowly using interpolation time.
SPOFS 0, 0,192,10
SPOFS 1,128,192,10

'wait until sprite has finished moving.
FOR I=0 TO 1:I=!SPCHK(0):NEXT

GOTO @MAINLOOP

it uses 2 big (64x32) sprites and they act as window.
sprite's priority has changed, so window sprites appear under the text.
by the way, you can set/change/load sprite for bottom screen.
sprite bank name for bottom screen is "SPS0" and "SPS1"
for example: LOAD "SPS0:MYSPRITE"
(note:unlike upper screen which has 512 sprites, bottom screen has only 118 different sprites.)


here is Graphic version.
Untitled

ACLS
CLEAR

'turn off bottom panel.
PNLTYPE "OFF"

'make some grass field.
BGPAGE 1
BGFILL 1,0,0,31,23,33,8,0,0

'select lower screen for Graphic.
GPAGE 1

'set Graphic priority to the behind of console
'so text will appear on top of Graphic layer.
GPRIO 1

@MAINLOOP

'wait for button press
FOR I=0 TO 1:I=BUTTON():NEXT

'start drawing line from bottom part of screen.
'fill upward.
'since filling with single line is too slow,I used x4 thick filled line.
FOR I=192 TO 128 STEP -4
GFILL 0,I,255,I+3,15
VSYNC 1
NEXT

'put some text
PNLSTR 1,18,"This is first line.",14
PNLSTR 1,20,"This is second line.",14
PNLSTR 1,22,"This is third line.",14

'wait for button press.
FOR I=0 TO 1:I=BUTTON():NEXT

'erase text with blank
PNLSTR 0,18," "*32,14
PNLSTR 0,20," "*32,14
PNLSTR 0,22," "*32,14

'erase window by drawing line with clear color 0.
'starting from top part of window. erasing downward.
'it will look like window is moving down.
'for speed, i used x4 thick filled lines.
FOR I=128 TO 192 STEP 4
GFILL 0,I,255,I+3,0
VSYNC 1
NEXT

GOTO @MAINLOOP

it simply draws white filled box on bottom.
as you draw more filled box upward, it will look like sliding window.
window box is erased with another box with clear color 0
Graphic layer's priority has changed, so Graphic window appears under the text.


here is BG version.
Untitled

ACLS
CLEAR

'turn off bottom panel.
PNLTYPE "OFF"

'select lower screen for BG.
BGPAGE 1

'make some grass field on rear BG layer..
BGFILL 1,0,0,31,23,33,8,0,0

'make window box just outside of bottom part of screen.
'use foreground BG layer, so it will hide grass field.
'using white blocks.
BGFILL 0,0,24,32,31,15,0,0,0

'and you can add cool window border frame if you want..
BGPUT 0,0,24,532,1,0,0
BGFILL 0,1,24,30,24,536,1,0,0
BGPUT 0,31,24,533,1,0,0
BGFILL 0,0,25,0,30,539,1,0,0
BGFILL 0,31,25,31,30,537,1,0,0
BGPUT 0,0,31,535,1,0,0
BGFILL 0,1,31,30,31,538,1,0,0
BGPUT 0,31,31,534,1,0,0

'this BG layer will wait outside of bottom part of screen and is ready to scroll up.

@MAINLOOP

'wait for button press
FOR I=0 TO 1:I=BUTTON():NEXT

'scroll foreground BG layer up slowly using interpolation time.
BGOFS 0,0,64,10

'wait until foreground BG layer has finished moving.
FOR I=0 TO 1:I=!BGCHK(0):NEXT

'put some text
PNLSTR 1,18,"This is first line.",14
PNLSTR 1,20,"This is second line.",14
PNLSTR 1,22,"This is third line.",14

'wait for button press.
FOR I=0 TO 1:I=BUTTON():NEXT

'erase text with blank
PNLSTR 0,18," "*32,14
PNLSTR 0,20," "*32,14
PNLSTR 0,22," "*32,14

'scroll foreground BG layer down slowly using interpolation time.
BGOFS 0,0,0,10

'wait until foreground BG layer has finished moving.
FOR I=0 TO 1:I=!BGCHK(0):NEXT

GOTO @MAINLOOP

it uses foreground BG layer and use it as window.
draw window box just outside of bottom of screen.
(you can add cool frame on window layer if you want)
it waits outside and will scroll up/down as needed.

ChangeV