DSiWare Forum

Topic: Petit Computer Tutorials

Showing 81 to 91 of 91

AuthorMessage
Avatar

MechaPikachu

81. Posted:

@DR4IG Move your question to the main thread with a code snippet and tag me. This thread is for finished tutorials.

These are not the codes you are looking for.

AuthorMessage
Avatar

GraphicGenius

82. Posted:

@Gimmemorecoinz why did you stop the tutorials?

"UGGGHHHHHHHHH I'm such a loser!" -PuppyCat from Cartoon Hangover
That explains my LIFE.

3DS Friend Code: 1478-3545-5136 | Nintendo Network ID: GreatGamer123

AuthorMessage
Avatar

Gimmemorecoinz

83. Posted:

@GraphicGenius I got very busy. Tutorials will be done soon. Don't worry :D

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

AuthorMessage
Avatar

Dsi_Mario

84. Posted:

Today I will be talking about GRAPHICS. So, let's execute two lines of code (ACLS clears everything)
ACLS
GFILL 0,0,1000,1000,5
Now, what happened? It should have filled the screen with the color 5. So, if you replace the 5 with a 1, it will fill the screen with color 1, and so on.
Let's break GFILL down.
GFILL says to your DS, "Execute the GFILL command"
The first number (0) is the x starting point.
The second number (0) is the y starting point.
The third number (1000) is the x ending point.
The fourth number (1000) is the y ending point.
The fifth number (5) is the color.
So, that line of code is making the computer fill in the screen starting at 0,0 and ending at 1000,1000.
The DS screen is 255 by 191, but you can do 1000,1000 and it will fill it all in.
If you want to see the colors of GRAPHICS, you can LOAD "GRPED" and see the colors form there.

Now, let's do GPSET.
Let's execute 2 lines of code.
ACLS
GPSET 100,100,5
So, it made a dot on the screen.
Let's break it down.
GPSET tells your DS to execute the GPEST command.
The first number (100) is the x coordinate.
The second number (100) is the y coordinate.
The third number (5) is the color.
So GPSET 100,100,5 tells your DS to make a color 5 dot at 100,100 (100,100 is about the middle of your screen. About.)

Dsi_Mario

AuthorMessage
Avatar

Mariominer

85. Posted:

I shall explain to you the differences in uses of strings and numbers. In general, a string is a collection of data of characters. We, however, can't see it like this because people realized that no one wanted to say Print 16,18,13,8,10,90. That's unmemorable, not to mention unreadable. So, we strings like this:
Print "This is a string."
Note the quotation marks. This is very important. If a string doesn't have them, it's considered a variable. Numbers are considered much differently. They have no separate data from their number, besides binary, which both characters and numbers have. In BASIC, characters and numbers are called upon with different variable types. Strings are called upon with (Variable)$ while numbers are just (variable). This means you can have a variable called A and a variable called A$. In order to turn one into the other, you can use this command for strings:
VAL(string)
You can add "&H" to the start of the string to find the value of a hexadecimal string. Like so:
VAL("&H"+string$)
To convert numbers to strings, you can do this:
STR$(number)
And it's simple as that. Note you can still print numbers, but can't do functions like MID$ or LEFT$.
Any function that ends with a $ can only be used with strings. Except functions that convert numbers to strings, like HEX$ or STR$. Now we know that strings are used in "$" functions. But what are so special about numbers?
Math. That's the answer. If you try to do this: "5"+2 you'll get an error (Don't know which one because I've never tried, but it will happen. Trust me.). This is because you're adding characters with numbers that aren't being converted to a string. If we did convert to a string, we'd still have a problem.
"5"+STR$(2)
This means you put "2" onto "5", making "52". If you turned 5 into a number, you'd make it work.
VAL("5")+2
Then you'll get 7. but you might ask me what happens if you divide/multiply/subtract from a string. Well, here's a list:
Divide: ERROR
Multiply: Makes x amount of that string, so "HI"*2="HIHI"
Subtract: ERROR
So these are the differences between numbers and strings, and my first program could've used a tutorial like this, because it took 2 keyboard inputs as string then added them. They were supposed to be numbers!

I'm the Doctor, I'm here to help.
{DALEK:}Do-ct-or? Ex- exterminate! EXTERMINATE!
-Doctor Who
Feel the extermination sensation.

3DS Friend Code: 1543-5315-3818 | Nintendo Network ID: Zeeman

AuthorMessage
Avatar

the5dimension

86. Posted:

well i just got petit i dont know how to program iv probably looked at about 30 tutorial and they dint help i wanted to program a rpg game but i need help learning to program is there anyone who can help me or write a tutorial or sumthing ill help me a lot

~the fifth dimension calls apond you~☆☆

AuthorMessage
Avatar

Mariominer

87. Posted:

@the5dimension, that depends on the kind of rpg you want to program. Text rpgs depend on basic math and printing, and of course input. Sprite rpgs are VERY difficult. Try to find some sprite tutorials - I don't know too much about that.

I'm the Doctor, I'm here to help.
{DALEK:}Do-ct-or? Ex- exterminate! EXTERMINATE!
-Doctor Who
Feel the extermination sensation.

3DS Friend Code: 1543-5315-3818 | Nintendo Network ID: Zeeman

AuthorMessage
Avatar

zeldafoursword

88. Posted:

hey there guys i need some help, i have understood the basics but i cant really understand how to put a sprite on the screen and make it move, could somebody please tell me how to do this? i would really appreciate

zeldafoursword

AuthorMessage
Avatar

Mariominer

89. Posted:

Here's something a little more complex-CHRSET (Or is it Setchr… Nope, definite CHRSET). If you don't understand hexadecimal, you can still read this, but in your code you can use HEX$.
So CHRSET has 3 parimeters. The setup looks like this:
CHRSET "resource name", character number, graphic string (in hexadecimal)
The resource name can be BGU(number), SPU(number) Or BGF. Character number can be from 0 to 255. For example, BGF 34 is the " character. The graphic string is the hardest part. Use a data string to make it visible what it will create in the tile, for example:
DATA "00000000"
DATA "01010101"
DATA "10101010"
DATA "02020202"
DATA "20202020"
DATA "03030303"
DATA "30303030"
DATA "00000000"
Yes, they are all numbers, so why the quotes? Because it's a graphic STRING. Strings always use quotes. Although with this command you can make quotes invisible. You can then read the data like this:
ACLS
CLEAR
DIM COLORS$(8)
RESTORE @DATA
FOR I=0 TO 7
READ COLORS$(I)
NEXT
And then the data will be read and stored on the array COLORS$. Anyway, before I get too carried away, more about the graphic string. The string represents colors on an 8*8 tile (that's how you would say it on computers). It moves horizontally, going down the column after it reaches the end. So a (clipped) string could be 888888887 And the color 7 would appear on the next line. These strings are lengthy, so it's difficult to put it on a line. Plus purely unreadable. This uses only 15 colors, 16 if you count invisibility. You can't separate the one and the 5 for 15, so you use hexadecimal. Colors 10-15 are stated with hexadecimal. A, B, C, D, E, and F represent 10-15. Again, you can use HEX$(number) to help, but it means you use different code entirely. Because of the colors, you can coordinate it with COLSET. COLSET isn't nearly as lengthy. It has these parameters:
COLSET "Color bank name", color number, and then color string (represented in HEX again).
The bank name can be "BG" (BackGround) , "SP" (Sprites), and "GRP", graphics. These change what kind of color it will change, so ensure you change the right color for your graphics. The Hex color string has the setup RRGGBB, or 2 characters allocated for each color, red, green, and blue. This will mix those colors, and set them at the point of color defined with the color number, used in each command that sets these things.

Examples of programs that put these functions to good use:
Village: Animates water and Colors depending on time.
Petit forest: Animates water and colors depending on time.
And that's all I know. Questions? Was I not clear enough?

I'm the Doctor, I'm here to help.
{DALEK:}Do-ct-or? Ex- exterminate! EXTERMINATE!
-Doctor Who
Feel the extermination sensation.

3DS Friend Code: 1543-5315-3818 | Nintendo Network ID: Zeeman

AuthorMessage
Avatar

Gimmemorecoinz

90. Posted:

@GraphicGenius I'll be starting them up again. I was very busy. I began a video tutorial series to.
https://www.youtube.com/watch?v=29bPoJFrBiI&feature=youtu.be This is episode one.
You can find episode two as well on my channel. I know I shouldn't advertise here but these ARE tutorial related. I hope the admins don't mind?

Kay cool. When I start my tutorial series it will be more advanced and itll go over creating large games. The thing that most people
really want help with is getting past print, cls.. etc. This video tutorial series if you follow it will go along basics and slowly work it's way up.
I'll also be making an intermediate video series alongside it for those who aren't newbies and i'll be releasing QR codes for each tutorial as well so you don't have to type the code yourself.

Game demos will be getting released demonstrating various things. CHeck the QR code sharing thread for one of the demos I released recently , it's a simple battle system framework. It can't really be a full game right now but you could learn from the code and the way it operates to make your own. IT DOESN'T use arrays ^_~ surprise surprise.

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

AuthorMessage
Avatar

Thecoolguy617

91. Posted:

I have a challenge ( I really need help with this though) for you all! Anyone who has the PRG: MPZL and tries to edit the file in any way, knows that it messes up Mario's Sprites. So I dare you (I'm begging, I had this issue for 2 years) to fix this and to show me how.

Please.

Thecoolguy617