Forums

Topic: Petit Computer

Posts 1,601 to 1,620 of 9,620

Kinsale

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

Pixelrobin

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.

3DS Friend Code: 3007-9228-5126

Discostew

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.

Discostew

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

With_Questions

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

Pixelrobin

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

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

swordx

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

With_Questions

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

swordx

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

With_Questions

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

Credible

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

ramstrong

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

Pixelrobin

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.

3DS Friend Code: 3007-9228-5126

Eel

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 Eel

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

Pixelrobin

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.

3DS Friend Code: 3007-9228-5126

petiSnail

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

Hamjam00

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:

ChangeV

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

Credible

I'm trying to save 2 SCR's to my computer. One is the background, the other is foreground. However, they both appear as foregrounds in PTCU.
I'm saving both of the SCR's to my sd card and then opening the PTC files in PetitComputer Utilites. I prefer making maps on my 3DS, so I don't want to make a map on the computer.
How do I make one SCR a background and the other SCR a foreground?

Edited on by Credible

Credible

Please login or sign up to reply to this topic