DSiWare Forum

Topic: Petit Computer

Showing 2,101 to 2,120 of 9,536

AuthorMessage
Avatar

Discostew

2,101. Posted:

MrSirr wrote:

How do you make it to where you hold down left right up or down on the d-pad to make your character keep moving that way?

Take the current state of the buttons from BUTTON(0), and do a comparison statement on the result. Up is equivalent to 1, Down is 2, Left is 4, and Right is 8. You can mix these together, such as 5 being Up and Left.

@MAINLOOP
VSYNC 1
BSTATE=BUTTON(0)
IF (BSTATE AND 1)==1 THEN 'Do stuff that results in the Up direction
IF (BSTATE AND 10)==10 THEN 'Do stuff that results in the Down-Right direction
GOTO @MAINLOOP

The above code is a simple check of those 2 specific directions (Up, and Down-Right). How you handle what those do is up to you.

"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

2,102. Posted:

Hey @Discostew, I've got a question for you. How do you manage to keep track of all those variables in your MM2 remake? I'm sure you have tons of variables, and I'm certain you have many "function calls", so how do you manage to make sure you're not re-using some old variable that was and still is important from a couple thousand lines away when you're in a function call? Just a personal question regarding your programming style I guess.

randomous

AuthorMessage
Avatar

Discostew

2,103. Posted:

@randomouscrap98

Well, for starters, I'm not one that likes to mix everything together unless I really need to, so I separate the different sections of my code, say like, one section for sprites, one for the levels, etc., and with each section, the variables, arrays, functions, etc. start with a shortened version of their section name, like for sprites, I would have names like SV_....., SA_....., @SF_....., etc, where S refers to sprites, V means variable, A means array, F means function (it's really used for label, but I think procedurally when I code when I can't think object-oriented). That in the very least segregates what stuff is designated with.

I don't recall how I handled some stuff in the original demo (as I have reworked a lot of stuff atm), but currently, with each "section", they each have an INIT case where unless that gets called, the entire section can't be used. With that INIT function, I create my arrays, set my variables, etc., making the likelihood of me re-using a variable for something else is reduced, as I just look into the INIT function and see if it was a;ready set for something. Then there are special variables that are meant to be re-used, like for FOR loops, where I start with, for example, SV_I for a sprite iterator, but if I have to use another, I go with SV_J for the next, then SV_K, etc.

I hope that makes sense. It does to me, but I'm odd like that.

"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

2,104. Posted:

@Discostew No no, it makes perfect sense. I guess I'm just not used to languages where everything is global, because I'm having a hard time keeping track of everything. When I'm working with an object-oriented language, it makes sense (to me anyway) to have different classes have similar member names, because it provides a consistent interface when you're trying to access them. Same for local variables within functions: if I have a counter, it makes it easier to spot if it's always called "counter" across all functions. But in BASIC, I guess I'll have to start being REALLY explicit with names. Thanks for the insight into your programming techniques!

randomous

AuthorMessage
Avatar

justlink

2,105. Posted:

how do you add mml

Hi
I'm Justlink1 on Miiverse, look me up.
Favorite Game: Spirit Tracks
Favorite Series: Zelda, SSB, Earthbound
Favorite childhood game: Sitting Ducks

AuthorMessage
Avatar

MrSirr

2,106. Posted:

2 things, how do you make two music notes play at the same time? 2, how would you make your own sprite, like a car?

MrSirr

AuthorMessage
Avatar

bigdog00

2,107. Posted:

I'm both happy and sad to announce the following: I'm officaily done with petit computer. It was a great introductory language. Thanks all for your support. @hamjam00 and I are officially starting our own (with some family help)............. Linux Distro! For those who don't know what that is, it is a modified/custom Linux flavor. I am now giving away the rights to CincOS :/. Just please give me some credit when you customize it. It is for EVERYONE, not just one person. I will post news on twitter and this site as well as @hamjam00 when we have progress. Thanks again.

Edited on by bigdog00

I like petit computer! Asphault 3d is awesome!

3DS Friend Code: 0473-8697-6288 | Twitter: bigdogdt

AuthorMessage
Avatar

Bluerobin2

2,108. Posted:

@bigdog00, you probably will try it out every once in a while when you're bored. You just can't leave the very thing you started with!

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Hairmanban19

2,109. Posted:

bigdog00 wrote:

I'm both happy and sad to announce the following: I'm officaily done with petit computer. It was a great introductory language. Thanks all for your support. @hamjam00 and I are officially starting our own (with some family help)............. Linux Distro! For those who don't know what that is, it is a modified/custom Linux flavor. I am now giving away the rights to CincOS :/. Just please give me some credit when you customize it. It is for EVERYONE, not just one person. I will post news on twitter and this site as well as @hamjam00 when we have progress. Thanks again.

Will we get to play the FPS you were working on?

...

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

justlink

2,110. Posted:

@bigdog00
you'll come back when i release my adventure time game. i just finished the first dungeon.

Hi
I'm Justlink1 on Miiverse, look me up.
Favorite Game: Spirit Tracks
Favorite Series: Zelda, SSB, Earthbound
Favorite childhood game: Sitting Ducks

AuthorMessage
Avatar

Discostew

2,111. Posted:

MrSirr wrote:

2 things, how do you make two music notes play at the same time? 2, how would you make your own sprite, like a car?

Do you know how to make music using the MML-script? It's real simple to play two notes in the same song. Use the ":x" command in the script, where x can be from 0 to 7 for a total of 8 different channels. If you mean playing two separate songs, then that's a matter of setting which song to which track using BGMPLAY (where the first argument is the track number from 0 to 7, and the second argument is the actual song number).

The simple and easy way to make your own sprites is to use CHRED, craft them in there, then save them. You then load up your sprite using the LOAD command, and assigning where it will be loaded to. There are 8 CHR slots for sprites, so if you wanted to load up your sprite block to slot 2, you'd do something like LOAD "SPU1:xxxx". SPU is the upper sprite section (you can't load custom sprites to the bottom screen), and 1 indicates the 2nd slot (it counts from 0 to 7). xxxx is the name of the CHR file that contains the sprite block. There are other ways to load sprites, but they are a bit on the complex side of things, requiring external tools and such.

"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

Morpheel

2,112. Posted:

So you'll stop using Petit Computer (a toy/game) because you'll start making a linux version?
Weird.

Oops, no username pun.

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

Bluerobin2

2,113. Posted:

@Morphtroid, it may be a toy, but it is one of the best toys I ever had and have. It's like a game with a level editor. But with infinityx possibilities. Of course, I'll leave it too someday. I'm learning much more complicating languages, but petit computer is just so special. I'm not doing that for a looooonnnng time. And @bigdog00, good luck. Who knows? Maybe you'll get very rich someday with cincOS? I'll be able to say that I helped you with the original :D. I really like the direction where cincOS is going. Keep it up!

Everybody do a chirp. CHIRP.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

Morpheel

2,114. Posted:

Oh no, I love petit computer, it's totally my favorite DSiWare... What I meant is that he's treating Petit Computer as if it were some sort of OS-developing tool or something, unable to be used for recreation... I found that odd. that's all. It's kinda like quitting Ace Attorney forever because you'll start reading law books, if that makes sense. Anyway, disregard me.

Btw, he also said he would be giving away the "rights" to Cincos, I assume that means he won't continue it.

Edited on by Morpheel

Oops, no username pun.

Oh look! A Morphloggery.
Oh! eShop Gurus.

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

AuthorMessage
Avatar

bigdog00

2,115. Posted:

Sorry for the confusion, I did not mean to treat it like that. I'll finish my FPS and upload it later. Btw, I am starting in Python with @hamjam00. I just want to be able to go to an nice collage and pay for my own stuff.

Edited on by bigdog00

I like petit computer! Asphault 3d is awesome!

3DS Friend Code: 0473-8697-6288 | Twitter: bigdogdt

AuthorMessage
Avatar

Anonymous_Ninja

2,116. Posted:

ive been keeping up with the forum for a long time and finally decided to post something xD. somebody said someone should make Rooted to the Ground a while back and i decided to do it. its almost done, but im getting an overflow error and im not exactly sure what that error means. help didnt describe it well so if any of you can explain it better thanks.

nope, no signature here...
I lied, here's my friend code: 2406-5448-5608

AuthorMessage
Avatar

randomous

2,117. Posted:

Anonymous_Ninja wrote:

ive been keeping up with the forum for a long time and finally decided to post something xD. somebody said someone should make Rooted to the Ground a while back and i decided to do it. its almost done, but im getting an overflow error and im not exactly sure what that error means. help didnt describe it well so if any of you can explain it better thanks.

Overflow can occur when the number you are trying to store in a variable is too large (or sometimes too small, called Underflow). For instance, Petit Computer variables can store numbers up to 524287 and down to -524287. If you're trying to store something like a million, you'd need to do some fancy math in order to merge two variable together to represent a single number. Here's an example of code which produces overflow:

A=1
FOR B=1 TO 10
A = A * B
PRINT A
NEXT

Right at the end, when B=10, A will try to store 362880 * 10 into itself, which is too large for A to hold, so you'll get the "overflow" error.

Edited on by randomous

randomous

AuthorMessage
Avatar

Anonymous_Ninja

2,118. Posted:

thanks now i know what the problem is, now i just need to fix that and add the achievements and it'll be done.

nope, no signature here...
I lied, here's my friend code: 2406-5448-5608

AuthorMessage
Avatar

Hairmanban19

2,119. Posted:

justlink wrote:

@bigdog00
you'll come back when i release my adventure time game. i just finished the first dungeon.

Adventure Time game! Adventure Time is my favorite show.How is it coming?

...

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

NJimmaculate

2,120. Posted:

Guys how do I make qr codes without retyping all the code
Into something

NJimmaculate

3DS Friend Code: 3308-5065-3976