DSiWare Forum

Topic: Petit Computer

Showing 2,501 to 2,520 of 9,308

AuthorMessage
Avatar

ChangeV

2,501. Posted:

bluerobin2 wrote:

@ChangeV Good job! The font I used is somewhat similar to yours. Do you mind? Anyone have ideas for touch screen though?

I don't mind.

Here is the outlined font I originally used in my game. (before I switched to my brother's font)

Untitled

Untitled

ACLS
CLEAR

'using default font.
CHRINIT "BGF"

'hide the process
'VISIBLE 1,1,1,1,1,0

FOR J=0 TO 255
'skip certain characters.
IF J==9 OR J==13 THEN NEXT
GFILL 0,0,7,7,0
'font outline
GPUTCHR 0+0,0-1,"BGF",J,1,1
GPUTCHR 0+1,0-1,"BGF",J,1,1
GPUTCHR 0+1,0+0,"BGF",J,1,1
GPUTCHR 0+1,0+1,"BGF",J,1,1
GPUTCHR 0+0,0+1,"BGF",J,1,1
GPUTCHR 0-1,0+1,"BGF",J,1,1
GPUTCHR 0-1,0+0,"BGF",J,1,1
GPUTCHR 0-1,0-1,"BGF",J,1,1
'font
GPUTCHR 0,0,"BGF",J,15,1
'set font
A$=""
FOR I=0 TO 63
C=(GSPOIT(I%8,I/8))
A$=A$+HEX$((C>=31)*14+(C==255),1)
NEXT
CHRSET "BGF",J,A$
NEXT

'VISIBLE 1,1,1,1,1,1

'display font
FOR I=0 TO 255
? CHR$(I);
NEXT
GCLS 10

first, get 1 letter from font.
draw black outline all around the letter.
then draw white letter inside.
put it back to font. next character...

it takes a while to process all the characters.
you can hide the process by turning off the GRP layer.
VISIBLE 1,1,1,1,1,0 (then back on. VISIBLE 1,1,1,1,1,1)

save and use it freely in your game if you like.

Edited on by ChangeV

ChangeV

AuthorMessage
Avatar

Gimmemorecoinz

2,502. Posted:

@randomous: Would you be willing to do something for me? Would you be willing to try to port another song, maybe not one from lttp but something else. :D how about the donkey kong country original theme for gameboy . The gameboy didn't have as many custom sounds. So this might be portable into MML what do you think? Would some of those pitch bends be possible? https://www.youtube.com/watch?v=JCmw1Lc06a4

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

Gimmemorecoinz

2,503. Posted:

I want to know also why some of this code isn't working, I'm getting all kinds of errors. Mostly, subscript out of range from PetitComputer. what am I doing wrong? Are multidimensional arrays limited? So confused! any help is greatly appreciated in advance thank you all for the help you've given me so far.

DIM BALLS(25,4)
FOR T=1 TO 10
NEGY=RND(2)
IF NEGY==1 THEN BALLS(T, 3)=1
IF NEGY==2 THEN BALLS(T, 4)=0
IF NEGY==2 THEN BALLS(T, 4)=BALLS(T, 4)-1
NEXT T

@MAIN

FOR T=1 TO 9

X=BALLS(T, 1)
Y=BALLS(T, 2)

SPEEDX=BALLS(T, 3)
SPEEDY=BALLS(T, 4)

X=X+SPEEDX
Y=Y+SPEEDY

IF X>192 THEN SPEEDX=SPEEDX+0-1
IF X<0 THEN SPEEDX=SPEEDX+2

BALLS(T, 1)=X
BALLS(T, 2)=Y
BALLS(T, 3)=SPEEDX
BALLS(T, 4)=SPEEDY

GCIRCLE BALLS(T, 1), BALLS(T, 2), 5

NEXT T

GOTO @MAIN

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

mystman12

2,504. Posted:

Could someone explain what DIM and DATA are for?

Future Pinball Table Development Blog Currently working on: Joe's Ultimate Bus Ride
I'm trying to share as many Wario Ware D.I.Y. microgames as possible, before WiFi is taken down. Share your microgames in this thread.

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter: mystman12

AuthorMessage
Avatar

Bluerobin2

2,505. Posted:

@ChangeV, I already made my own font. It looks kind of like yours but the letters are blocky.

Houston, We have a Syntax Error.

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

3DS Friend Code: 3007-9228-5126

AuthorMessage
Avatar

ejamer

2,506. Posted:

Gimmemorecoinz wrote:

I want to know also why some of this code isn't working, I'm getting all kinds of errors. Mostly, subscript out of range from PetitComputer. what am I doing wrong? Are multidimensional arrays limited? So confused! any help is greatly appreciated in advance thank you all for the help you've given me so far.

...

You realize that arrays start counting at zero, right? So if your array is: Balls(25, 4) then the first element is Balls(0,0) and the last element is Balls(24, 3).

I didn't look into the code very much at all, but it looked like that was a problem and it would explain all the "subscript out of range" errors.

ejamer

AuthorMessage
Avatar

randomous

2,507. Posted:

@Gimmemorecoinz I can try the Donkey Kong song from the GB. Also, arrays are indexed starting from 0, not 1. This is why you're having problems, your BALLS(25,4) array can only go up to 24 in the X and 3 in the Y.
Edit: Whoops, someone already said that!

@mystman12 DIM is used to set a hard limit on the size of an array. An array is a variable that can hold a collection of values instead of just one. The DIM command tells a variable to become an array of that size.
DATA commands allow you to define static data (data that doesn't change, like a map or something) within the program, which you can read later with the READ command. These can go anywhere really, but they must be preceded by a label. For instance:

`Program Start
DIM MYARRAY(10)

RESTORE @MYINFO
FOR I=0 TO 9
READ MYARRAY(I)
NEXT

@MYINFO
DATA 9, 5, 2, 3, 7
DATA 6, 8, 1, 4, 0

Now MYARRAY will have the values 9 5 2 3 7 6 8 1 4 0 in that order. The RESTORE command tells the program where to start looking for data. The READ command reads a single value from the DATA portion and stores it into the variable that follows it. Notice that I used commas in between the data, that signifies the separation between the data that will be retrieved with the READ command. You can have multiple lines of data, just like I have, and it won't change the way the data is read. I could have had 10 DATA lines each with one value and it would have still been the same. Hope that helps!

Edited on by randomous

randomous

AuthorMessage
Avatar

ejamer

2,508. Posted:

mystman12 wrote:

Could someone explain what DIM and DATA are for?

DIM is short for "dimension", and is used to create an array of the size you want. (An array is basically a variable with one name that can hold many different values.)

For example, if you were working on a program that would play a simple card game you might write code like the following:

DIM DECK(52);
FOR I=0 TO 51
DECK(I) = I+1
NEXT I

FOR J=0 TO 51
SWAP DECK(J), DECK(RND(52))
NEXT J

The first part would create an array the size of a deck of cards, and then gives unique values to each entry in the array. The second part "shuffles" the deck by swapping each array value with one other randomly selected array value.

Some important things to know about arrays and the DIM statement:

  • you can only use DIM once for each array, after that the array is permanently set at the specified size; trying to use DIM a second time with the same variable will cause your program to crash with an error
  • if you treat a variable like an array without using DIM, then Petit Computer acts like you used DIM arrayname(10) by default

So what is DATA all about? Well, the first thing to know is that you don't use DATA on it's own: you also need to understand the READ and RESTORE commands.

You may want to store information that doesn't change in your program Maybe this means map data, or music data, or any other kind of information that won't change. The RESTORE/READ/DATA commands come in really hand here! They let you separate all that non-changing information from the body of your coding. DATA statements don't do anything other than contain a list of comma-separated data values. They are often found at the very bottom of a program, sitting somewhere after the END statement. The real action takes place when READ is used - this command tells Petit Computer to return the next DATA value and store it in a variable, ready to be used for whatever purpose you want.

DIM SUIT$(4);
FOR I=0 TO 3
READ SUIT$(I)
NEXT I
END
DATA "Diamonds", "Hearts", "Clubs", "Spades"

One last note: if you are using READ/DATA commands, then you need to understand what value will be returned at what time. When you use READ, Petit Computer starts looking from the beginning of the program for the first DATA statement, and then takes the first value from that statement. Every time you use READ after that point in time, it just jumps to the next comma-separated value, and if there is no next value in that DATA statement it will jump to the next line that does have a DATA statement in your program. If you use READ and there are no DATA statements left to read from, an error occurs.

This brings up two interesting points: you might need to add a "dummy" value at the end of your DATA statement so you know when to stop reading, and you should understand that you can (at any time) use the RESTORE command to change where Petit Computer will look for the next DATA value.

@START
READ L$
IF L$=="-1" THEN RESTORE @LETTERS: READ L$
PRINT "Letter "; next_letter$
INPUT "Again"; q$
IF q$=="Y" GOTO @START
PRINT "Bye!"
END
DATA "a", "b", "c"
@LETTERS
DATA "d", "e", "f", "-1"

Hope this all helps.

ejamer

AuthorMessage
Avatar

ejamer

2,509. Posted:

randomouscrap98 wrote:

...
Edit: Whoops, someone already said that!
...

So I beat you to the first question, you beat me to the second. Guess we're even? ;)

Edited on by ejamer

ejamer

AuthorMessage
Avatar

randomous

2,510. Posted:

@ejamer Haha I guess so.

randomous

AuthorMessage
Avatar

mystman12

2,511. Posted:

Okay, thanks, I think that helped a little, but I keep seeing stuff like "FOR I=0 TO 51", what is that for?

Future Pinball Table Development Blog Currently working on: Joe's Ultimate Bus Ride
I'm trying to share as many Wario Ware D.I.Y. microgames as possible, before WiFi is taken down. Share your microgames in this thread.

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter: mystman12

AuthorMessage
Avatar

ejamer

2,512. Posted:

mystman12 wrote:

Okay, thanks, I think that helped a little, but I keep seeing stuff like "FOR I=0 TO 51", what is that for?

Without trying to brush you off, if you don't understand how a FOR-NEXT statement works then you need to do some basic learning before asking questions.

Visit these links and read through the tutorials:
http://petitcomputerbasic.blogspot.com/
http://www.3dsbuzz.com/3ds-forum/threads/petitcomputer-tutori...
http://www.gamefaqs.com/boards/663843-petit-computer/63494042

Those are the best links I could find on short notice, although someone else might be able to point you to other online resources. Don't look for specific answers yet - just learn everything they talk about because you will need to know it all.

Post question when stuff doesn't make sense, but you'll need to make an effort to get started. The good news: it's worth the effort, and you'll be programming in no time if you take the time to walk through some of these tutorials!

ejamer

AuthorMessage
Avatar

mystman12

2,513. Posted:

Okay, thanks! I do know about some of the basics (Such as variables, printing, GOTO, etc.) and I have started learning about sprites, but I guess there is sill a lot more to go! I'll start reading all of this!

Edit: Oh, wait! I've actually used one of those tutorials before, and now some of the stuff I've forgotten is coming back to me!

Edited on by mystman12

Future Pinball Table Development Blog Currently working on: Joe's Ultimate Bus Ride
I'm trying to share as many Wario Ware D.I.Y. microgames as possible, before WiFi is taken down. Share your microgames in this thread.

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter: mystman12

AuthorMessage
Avatar

ejamer

2,514. Posted:

mystman12 wrote:

... variables, printing, GOTO, etc. ...

Great start! Add in subroutines, IF-THEN conditions, and FOR-NEXT loops and you've got a pretty good background for simple programs. :)

Sprites and graphics are really a whole leap above that. Not that they are hard - Petit Computer makes it pretty easy to start working with sprites, actually - but there is another layer of learning involved and plenty of trial-and-error moments. I'm a complete novice in that regard.

ejamer

AuthorMessage
Avatar

mystman12

2,515. Posted:

Thanks for those tutorials! I read went through them all and I feel much more confident!

Future Pinball Table Development Blog Currently working on: Joe's Ultimate Bus Ride
I'm trying to share as many Wario Ware D.I.Y. microgames as possible, before WiFi is taken down. Share your microgames in this thread.

3DS Friend Code: 0259-0292-5888 | Nintendo Network ID: mystman12 | Twitter: mystman12

AuthorMessage
Avatar

steriaca

2,516. Posted:

Anybody thinking of a date simulater game? (Or prehaps a hibread game with date simulater aspects like Sakura Wars) That is one gendra of game I have yet seen in Petit Computer.

My Friend Code is 3368-1310-0690.

AuthorMessage
Avatar

Hairmanban19

2,517. Posted:

randomouscrap98 wrote:

If anyone's getting tired of me polluting this thread with all these songs, please let me know. Here's the Underwater theme from Super Mario Bros.

Untitled

More great music! I would never get tired of you making music!

Nintendo ID: Hairmanban19. Working on a secret PTC project... If you're wondering why the knight in my profile pic has a shovel, here is the explanation: http://yachtclubgames.com/shovel-knight/

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

Gimmemorecoinz

2,518. Posted:

Wow suddenly after waiting 16 hours i finally got reply, thanks to everyone who commented on my question.
I didn't realize.. that the second dimension in the multidimensional array would start at 0 by default.. everything is offset by 1 >.< That makes it confusing.
That's usually why in these languages I Just cheat by making my arrays one size larger than they need to be, and when that didn't work I made it even bigger...
guess that I forgot to account for the second dimension of that array.. figures i guess o.0

I'm making an AI still and it's slowly coming along but I need help writing code which helps me to parse some input. I think I know where I went wrong now though with my last scripting thing.

@randomouscrap I'd be thrilled if you could manage to do a dkc gb mix remake thing.
Has anyone here played with fami tracker i'm finding it hard to use but I used to use it and I was ok with it. I found more out about it today then ever before..
I'm thinking of doing some 8 bit chiptune related stuff.. unfortunately it doesn't have an option to export to MML I don't think.
Are there any trackers that can export to MML?

who here wants to help with my lttp thing?
I'm sorry that I haven't still looked at Coral Maze yet u_u I've been busy. But I'll take a look at it today. I'm really good at programming logic so it shouldn't take me more than a few minutes to figure out how it works, and then I can spend a few hours adding to it :D yay! ^^;

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

Hairmanban19

2,519. Posted:

ejamer wrote:

mystman12 wrote:

Okay, thanks, I think that helped a little, but I keep seeing stuff like "FOR I=0 TO 51", what is that for?

Without trying to brush you off, if you don't understand how a FOR-NEXT statement works then you need to do some basic learning before asking questions.

Visit these links and read through the tutorials:
http://petitcomputerbasic.blogspot.com/
http://www.3dsbuzz.com/3ds-forum/threads/petitcomputer-tutori...
http://www.gamefaqs.com/boards/663843-petit-computer/63494042

Those are the best links I could find on short notice, although someone else might be able to point you to other online resources. Don't look for specific answers yet - just learn everything they talk about because you will need to know it all.

Post question when stuff doesn't make sense, but you'll need to make an effort to get started. The good news: it's worth the effort, and you'll be programming in no time if you take the time to walk through some of these tutorials!

Thank you for posting this! It is really helping me to learn BASIC!

Edited on by Hairmanban19

Nintendo ID: Hairmanban19. Working on a secret PTC project... If you're wondering why the knight in my profile pic has a shovel, here is the explanation: http://yachtclubgames.com/shovel-knight/

3DS Friend Code: 3136-7615-5907

AuthorMessage
Avatar

VincentFaraday

2,520. Posted:

I'm planning on making a program this summer that can solve differential equations by building onto my quadratic solver. I know that petit computer can't float very many numbers, but I thought that this would be a fun thing to do this summer. When it comes to math, I have finished Calculus and I have just finished a course on differential equations. If anybody here has an expertise in this area of programing/mathematics, then let me know. :]

I wish I was on the Enterprise.

3DS Friend Code: 1048-8460-1195