DSiWare Forum

Topic: Petit Computer

Showing 7,961 to 7,980 of 9,530

AuthorMessage
Avatar

InsertPi

7,961. Posted:

@Leviceljir can you give more details on the bug? I'm not having any problems with it. It may be a problem with the map conversion.

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

7,962. Posted:

@IAmAPerson
I thought it might be a map coversion bug too but I tried it in a fresh world and it still wasn't working... I don't know what its doing it for... I'll go try some stuff and tell you my results.

Hi I'm Levi and I like Bloopys :^)

AuthorMessage
Avatar

LeviCelJir

7,963. Posted:

@IAmAPerson
Ohhh after a experiment or two I found out the problem. Certain blocks won't break using the "break block" button on the bottom screen but will work with L button. Which is a mega problem for me because my L button has trouble working...

Hi I'm Levi and I like Bloopys :^)

AuthorMessage
Avatar

InsertPi

7,964. Posted:

@LeviCelJir ahhhhhhhhh I know what's going on. I done goofed when I was changing that 400 lines of code. I'll release a Beta 1.8.1 bug fix that fixes a few other bugs in a couple days. I can tell you how to fix it yourself though. On lines 458 and 459. Change

IF BSTAT AND TDS AND MAP(I,J)AND...
IF BSTAT AND !TDS AND MAP(I,J)AND...

to

IF BSTAT AND TDS AND MAP(I,J)>0AND...
IF BSTAT AND !TDS AND MAP(I,J)>0AND...

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

7,965. Posted:

@IAmAPerson
Yay! I can play my 1.5 map in 1.8 without bedrock wood! and bedrock TNT.

By the way... I can tell I'm gonna be a great 2.0 tester :3 I found an annoying bug on the first day!

P.S. Converting my map was easy. You made it out like it was the hardest thing in the world. You were like "Oh yeah Levi Converting maps isn't easy anymore. It will be hard. I recommend just giving up your world. Well... Have fun!"

...It...Was...So...Easy...

Edited on by LeviCelJir

Hi I'm Levi and I like Bloopys :^)

AuthorMessage
Avatar

ramstrong

7,966. Posted:

Thanks TBD. Sorry for the trouble. I don't suppose you can make the Tutorial thread "sticky", do you? It would be helpful, so we don't have to point to it every so often.

TexMurphy wrote:

@ramstrong
I typed in both of your walking programs. In your character walking tutorial, change SPCHAR to SPCHR under @ANIM. Can you write a tutorial where the character stops moving when the Dpad is released? Thanks
What we need are templates for platform games, rpgs, fighting games, and side scrollers.

You know, you don't have to ask me about it. Lots of other qualified people can answer that question for you. If you look at the latest Tutorial entry, you'll see an extra mode for "STOP". So, you'll need to add that in if you want to stop.

Actually, that's a simplification of the process. A more sophisticated version would be to determine the walking speed. So, stopping is simply zero speed. An easy way to do it would be to reset the speed every time you ask for direction.

B=BUTTON(0)
SPEED=0:'INSERT THIS HERE
IF B AND 1 THEN D$="U":SPEED=20
IF B AND 2 THEN D$="D":SPEED=20
IF B AND 4 THEN D$="L":SPEED=20
IF B AND 8 THEN D$="R":SPEED=20

And on @ANIM, you want to set the speed accordingly. Something like this:

@ANIM
SPCHR 2,A
SPANIM 2,4,SPEED/4
SPOFS 2,SX*16,SY*16,SPEED

You need to be careful and go through the program logic, and make sure SX,SY are unchanged when the speed is zero, but I'm sure you'll be able to do that no problem. Once you've done that, you may want to adjust SX,SY values according to SPEED variable. Right now it's based on 16x16 grid. You can change that to SX*SPEED*RATIO, instead. (This is just an example, you don't type that in exactly and expect it to work.)

Another way to look at it would be a simplification of the whole process. Think of turn based game. Do you want to go UP, DOWN, LEFT, RIGHT, SHOOT, or do STOP? And simply build a table to reflect that. That's what I did on my last entry, and it's so easy, I built the whole program all at once.

Currently, the program assumes that if you don't give any input, you want to keep going where you're going. In other words, the last directional command. However, it can be changed so that the default would be, if you don't give any input, the default command would be STOP.

HTH.

Speaking of templates, I'll be doing a few sprite games templates (similar to WITCH, but encompassing more game types). Then I'll be doing something like a dungeon level editor (256x192 in size). So, that's something to look for ... in the (very far) future.

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

cigsthecat

7,967. Posted:

Discostew wrote:

cigsthecat wrote:

Aha! That makes sense, thank you. I suppose using CLEAR every time right before DIM is the way to go.

CLEAR does as it says, clears the memory, which means all variables and arrays will be erased/reset. I usually put it near the start of my program so I know I'm starting with fresh memory to work with.

OK, gotcha.

ramstrong wrote:

cigsthecat wrote:

Aha! That makes sense, thank you. I suppose using CLEAR every time right before DIM is the way to go.

Well, I guess now you know why I did CLS:CLEAR on my program. Those two do different things. :)

Yep! I realized that.

I was looking at this Morpheel tut, and I have some questions.

Morpheel wrote:

Eh let's see...
You have
@MAP1
DATA "111111"
DATA "100001"
DATA "102201"
DATA "102201"
DATA "100001"
DATA "111111"

And you want to use that data to draw a 6*6 room using some background tiles.

LABEL$="@MAP1" 'set the label where the DATA is

As I understand it, LABEL$ is a custom string variable, yes? So it doesn't need to be LABEL$, it could be any text ending with $?

@DROOM 'a subroutine to draw a 6*6 room using DATA
RESTORE LABEL$ 'set the DATA pointer to that label

Could someone explain a bit about the RESTORE function? I have a basic understanding of GOTO and GOSUB-RETURN. How is it different from those?

Also why is it necessary to set LABEL$="@MAP1"? Couldn't you simply do RESTORE @MAP1?

FOR Y=0 to 5 'start Y for
READ L$ 'read a line of DATA

I see L$ here (short for LABEL$?). Why does this work?

FOR X=0 to 5 'start X for

Why don't we need another "READ L$" here for X?

IF MID$(L$,X,1)=="0" THEN BGPUT 0,X,Y,45,8,0,0 'draw background tile 45 if the Xth data of the Yth DATA line is 0
IF MID$(L$,X,1)=="1" THEN BGPUT 0,X,Y,54,8,0,0 'draw background tile 54 if the Xth data of the Yth DATA line is 1
IF MID$(L$,X,1)=="2" THEN BGPUT 0,X,Y,65,8,0,0 'draw background tile 65 if the Xth data of the Yth DATA line is 2

So if we imagine the 6x6 DATA square as 6 columns- is this function reading the numbers from the top to the bottom of column one, then doing the same for the others moving left to right?

NEXT X:NEXT Y 'Move on
RETURN 'Return

Here he's using a RETURN without a GOSUB. Is this just here out of habit since you'd expect to arrive at all of this code via a GOSUB as part of a larger program?

Sorry if these questions are super basic (haha), but I really like how this works and want to understand it better.

here's Morpheel's code without my interruptions:

Morpheel wrote:

Eh let's see...
You have
@MAP1
DATA "111111"
DATA "100001"
DATA "102201"
DATA "102201"
DATA "100001"
DATA "111111"

And you want to use that data to draw a 6*6 room using some background tiles.

LABEL$="@MAP1" 'set the label where the DATA is

@DROOM 'a subroutine to draw a 6*6 room using DATA
RESTORE LABEL$ 'set the DATA pointer to that label
FOR Y=0 to 5 'start Y for
READ L$ 'read a line of DATA
FOR X=0 to 5 'start X for
IF MID$(L$,X,1)=="0" THEN BGPUT 0,X,Y,45,8,0,0 'draw background tile 45 if the Xth data of the Yth DATA line is 0
IF MID$(L$,X,1)=="1" THEN BGPUT 0,X,Y,54,8,0,0 'draw background tile 54 if the Xth data of the Yth DATA line is 1
IF MID$(L$,X,1)=="2" THEN BGPUT 0,X,Y,65,8,0,0 'draw background tile 65 if the Xth data of the Yth DATA line is 2
NEXT X:NEXT Y 'Move on
RETURN 'Return

That way you can write yourself multiple DATA structures with number variations to draw different rooms using the same code.
Or something like that.

Edited on by cigsthecat

cigsthecat

AuthorMessage
Avatar

ramstrong

7,968. Posted:

cigsthecat wrote:

As I understand it, LABEL$ is a custom string variable, yes? So it doesn't need to be LABEL$, it could be any text ending with $?
Also why is it necessary to set LABEL$="@MAP1"? Couldn't you simply do RESTORE @MAP1?

Yes, LABEL$ is simply a string variable, and you can use anything you want. You can also do RESTORE @MAP1 directly if you want, but using string is more flexible.

RESTORE isn't like GOTO/GOSUB in that the program execution does not go there. It simply tells the program, whenever you see a READ command, this is the data you want to read. RESTORE is used to select different parts of DATA section. Say you have DATA for sprites, and background data. You can write
@SPRITE
DATA ...

@BGDATA
DATA ...

And use RESTORE @SPRITE or @BGDATA to select which DATA you want to load, either sprite data or background. However, program execution does not go there. It's simply used to set which data you want to read. Think of it like a file-selector switch, instead of GOTO/GOSUB

I see L$ here (short for LABEL$?). Why does this work?

No. L$ is a normal variable, not short for LABEL$. L$ is the variable containing the data "111111", "100001", "102201" and so on. Think of READ as a substitute for INPUT. Whenever you want non-interactive INPUT, you use READ (which reads the input on DATA)

Why don't we need another "READ L$" here for X?

Because X is used to go through the characters in L$ using MID$ command. Think of it as FOR X=0 to LEN(L$)

IF MID$(L$,X,1)=="0" THEN BGPUT 0,X,Y,45,8,0,0 'draw background tile 45 if the Xth data of the Yth DATA line is 0
IF MID$(L$,X,1)=="1" THEN BGPUT 0,X,Y,54,8,0,0 'draw background tile 54 if the Xth data of the Yth DATA line is 1
IF MID$(L$,X,1)=="2" THEN BGPUT 0,X,Y,65,8,0,0 'draw background tile 65 if the Xth data of the Yth DATA line is 2

That's just a translation table. 0=45. 1=54. 2=65.

Here he's using a RETURN without a GOSUB. Is this just here out of habit since you'd expect to arrive at all of this code via a GOSUB as part of a larger program?

Part of a larger program. You see him using the word "subroutine". You use GOSUB @DROOM.

Sorry if these questions are super basic (haha), but I really like how this works and want to understand it better.

Those are good questions, so I don't mind. Of course, there's more than one way to learn. There's more than one post regarding DATA. So, it's a good idea to read all the tutorials to get an overview of things. :)

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

ramstrong

7,969. Posted:

I updated October Petit Computer Journal. Finally. Randomous' Solitaire Depackaged is mentioned there, FYI. November is also up. I'll be working with Virtual Keyboard for November. Between main loop and user interface, I should be able to handle quite a lot of things with ease.

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

cigsthecat

7,970. Posted:

Thanks ramstrong, that helps me a lot.

cigsthecat

AuthorMessage
Avatar

Slayer

7,971. Posted:

I am having problems with Apocalypse Rising, go figure.
I tried to display HP in the corner of the screen, but it never displays. I used LOCATE to direct the text where it should go, but it never displayed. I tried creating a variable called HP and assigned the text 100 to it, but it did nothing! It might not have worked because there is a VERY slight chance I did it the C++ way...

"Hello sir, may I take your order?"
"Yes, I'll have a cheeseburger and fries..."
"I AM the cheeseburger and fries!"
Things you need to know about me:
I hate Texas.

AuthorMessage
Avatar

Bluerobin2

7,972. Posted:

@0Games you may have put a cls after the print. It needs to be vice-versa.

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Lego-Meister

7,973. Posted:

@IAmAPerson why is there always green above every block an MCDS? Can I remove it somehow?

Edited on by Lego-Meister

Some programmers pride themselves on how many more lines of code they can write. I pride myself on how many less.

3DS Friend Code: 3652-1447-0455 | Nintendo Network ID: Legos-Meister

AuthorMessage
Avatar

Zalkia-ent

7,974. Posted:

i think it's green because IAmAPerson probibly does not have time.maybe in a future update where every block will have its own grapic on top of every block.and I thought about the same thing to :D

email:zalkiaent@gmail.com
if facebook,myspace,instagram and twitter were all shut down, 90% of the teenage population would go insane. if your one of the 10% that would be laughing at them, copy&past this to your signature and hope it happens. Wait... NO!

AuthorMessage
Avatar

Zalkia-ent

7,975. Posted:

in a little while ill post the qr's for a progam I made called,petit madness.the program is a text progam it just tells a story that your in.it has some humer in it to!at the first one you get sucked into minecraft here are the program names.the first one is named pro3,pro stands for program.but I hope you like it :)

email:zalkiaent@gmail.com
if facebook,myspace,instagram and twitter were all shut down, 90% of the teenage population would go insane. if your one of the 10% that would be laughing at them, copy&past this to your signature and hope it happens. Wait... NO!

AuthorMessage
Avatar

InsertPi

7,976. Posted:

@Lego-Meister well...the raycasting algorithm (the thing that draws 3D using 2D commands) only draws sides of the blocks, and not the tops or bottoms, so it's the same colour of the grass. You can't remove it unless you add something that draws the tops/bottoms of blocks/floors/ceilings, a Raytracer. I have one made by @calc84maniac, but it is way to slow. I might add it when PTC3D comes out, with 10x interpretation speed.

Edited on by InsertPi

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

Lego-Meister

7,977. Posted:

IAmAPerson wrote:

@Lego-Meister well...the raycasting algorithm (the thing that draws 3D using 2D commands) only draws sides of the blocks, and not the tops or bottoms, so it's the same colour of the grass. You can't remove it unless you add something that draws the tops/bottoms of blocks/floors/ceilings, a Raytracer. I have one made by @calc84maniac, but it is way to slow. I might add it when PTC3D comes out, with 10x interpretation speed.

A raytracer? Wow. Where could I get the QRs for this?

Some programmers pride themselves on how many more lines of code they can write. I pride myself on how many less.

3DS Friend Code: 3652-1447-0455 | Nintendo Network ID: Legos-Meister

AuthorMessage
Avatar

boot

7,978. Posted:

I think @morpheel completely abandoned petit computer. I was just on his page and 5 hours ago he commented n a different page. I hope that he comes back to this page!

Just your average talking boot. The Boot that can program.

AuthorMessage
Avatar

twinArmageddons

7,979. Posted:

Untitled
i'm polishing the special attacks now :D
here's some more screenshots:
http://imageshack.com/a/img22/8494/wq05.jpg
http://imageshack.com/a/img38/8822/byzr.jpg
http://imageshack.com/a/img812/9094/j09d.jpg

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

AuthorMessage
Avatar

ramstrong

7,980. Posted:

boot wrote:

I think @morpheel completely abandoned petit computer. I was just on his page and 5 hours ago he commented n a different page. I hope that he comes back to this page!

Haven't seen him since Pokemon came out. I don't think we'll see him anytime soon, TBH. He'll be back right around Petit Computer 3D.

I was scanning tutorial page and only 2 people are active there recently: Me, and Gimmemorecoinz. Except, Coinz left (Does anybody know why she left?). So, there's only me. If there's only me, then I won't be posting there anymore. I'd rather do it on my blog instead.

Of course, I don't have a tutorial blog. It's a journal, not tutorial. So, it won't be as educational as it can be. Either I'll have to start something else, or you'll have to suffer my journalistic style. Sigh.

Any volunteer to post on Tutorial thread?

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855