Word of warning - you'll likely find Petit Computer somewhat limiting in comparison to C++. It's not necessarily a bad thing - it will force a lot of creativity and novel solutions to problems - but you'll notice a difference, especially if you use object-oriented programming to any extent.

Having said that, the people on this forum are doing great things with Petit Computer, so it by no means implies that fun games can't be made.

I used to have a blog link here. I'll put it back up when the blog has something to read.

Word of warning - you'll likely find Petit Computer somewhat limiting in comparison to C++. It's not necessarily a bad thing - it will force a lot of creativity and novel solutions to problems - but you'll notice a difference, especially if you use object-oriented programming to any extent.

Having said that, the people on this forum are doing great things with Petit Computer, so it by no means implies that fun games can't be made.

I agree. Just look at Petit Farm. And the tons of fun Japanies programs like Luna City, Shooting Life, and TriStones.

While we are waiting for thoes awsome American (and other english speeking) games (cause it takes time, and Rome wasen't built in a day), we do have Petit Farm and a lot of willing programers in this and the fourm at GameFAQ.com. And the vareous Petit Computer Wikias.

Not sure if this has been asked here yet, about to go to bed and don''t have time to search, sorry. I am creating a program that will have a button menu on the touch screen, I will be using GPAGE so I can have multiple menus, I was wondering if there is a way to create extra images on top of the ones I already have there, but make them invisible until the touch pen is touching its area. I am hoping this is possible instead of constantly erasing and redrawing things? I ask because I will have the code set to only respond to the touch of a button when the pen is finally removed from the touch screen (so the user can change his mind and possibly slide over to a non button before lifting the pen), I think changing buttons will be a nice touch, and actually required for some things that need to stay pressed for a time. I hope I have described the situation well, I sometimes have a hard time taking myself away from knowing what I am talking about to explain it to someone who doesn't.

@Shadow1364: That was actually a joke, I don't think anyone would like to play it that way considering it takes so long to draw everthing, but it is not completely impossible.

@Tiger: I'm almost sure you can't draw transparent things with petit computer (and everything drawn out of view is instantly erased too). But there should be a way to solve it... I don't know it, but there must be. Try looking for petit games online that use animated touch-buttons.

So, I didn't find anything for animated buttons with a google search, but I did get an idea. While graphics may not be able to exist off screen I know backgrounds can, so I just need to set up gosubs for each button to draw or erase it as needed. While more complicated than I was hoping for, this is actually not as bad as I was originally planning if I keep the extra buttons ready and off screen to just copy over, I can even set up the second button screen and offset the screen to show that one instead. Quick question about offset, does it change what the tchx and tchy will read, or is it strictly changing what you see (ie. will I need to set up the second menus touch commands based on their coordinates outside the normal screen or for where they appear after the offset)

To save a mem file you need to fill the MEM$ variable.
What SAVE "MEM:NOTE" does is create a MEM file named NOTE with the contents of MEM$ (which in this case is empty because you haven't added anything to it yet).

By they way, you're asking for user input for P$ and then replacing that with STR$(NOTE), which makes no sense.

That should change the contents on the local MEM$ variable with the contents on the MEM file named NOTE.
It will not automatically assign the values stored on it to the correct variables, it all will go to MEM$ and it is your job to reassign the values.

There's something about this in the Tutorials thread too, if you want to read more.

@bloodofgore
as far as touch buttons go you can't technically make them, but we can fake it.
first you need to get rid of the keyboard with PNLTYPE "OFF"
then put an image on the bottom screen, I usually use background drawing for this; BGPAGE 1;BGFILL L,X1,Y1,X2,Y2,NUM,PAL,HR,VR
L=layer, you can put it on layer 0 or 1; X1Y1= starting x/y coordinates; (top left) X2Y2=ending X/Y coordinates(bottom right); NUM=character number in the background image database (which can be customized, but that is for later); PAL=pallet to use for the image; HRVR=horizontal/vertical rotation (0 for none, 1 to flip along that axis)
now you have the "button" on the screen we need to set up recognition for the touch.
you need to create a loop (or add to a loop you already have) a check for if the screen is touched (with multiple buttons it can speed up performance if you set this as an initial check so it doesn't have to go through the rest if the screen is not touched) then compare the TCHX and TCHY variables to the location of the button (use floor(TCHX/8) and same for Y to get direct number, because TCHX and Y use pixel numbers). Here is an example
PNLTYPE "OFF"
BGPAGE 1;BGFILL 0,15,15,17,17,4,0,0,0@LOOP
IF !TCHST THEN GOTO @LOOP
TX=FLOOR(TCHX/8);TY=FLOOR(TCHY/8)
IF (TX>=15 AND TX<=17 AND TY>=15 AND TY<=17) THEN GOSUB @PRESSBUTTON
GOTO @LOOP

if you need to do other things you can add the TCHST and TCHX/Y to whatever loop you already have doing things. I personally use a seperate gosub to check for touches when I am doing lots of other checks or manipulations. I read that PETIT COMPUTER can read 2000 lines of code in a single frame, so you don't really have to worry about it not catching the touch unless you have lots of code in your loop.

Advanced trick: this is what I use now, it lets the user change their mind by not considering the button touched unless they lifted the stylus from the button (if they touch it and move off it it does nothing). just showing the loop

R=0@GETTOUCH'(THIS IS CALLED INTO AS A GOSUB)
TOUCH=0
TX=FLOOR(TCHX/8)
TY=FLOOR(TCHY/8)
IF TCHST THEN R=1:RETURN '(IF TCHST is short for IF TCHST==TRUE
IF !R THEN RETURN'(IF !R is short for IF R==0)
R=0
IF (TX/TY BOUNDS AS ABOVE) THEN TOUCH=1
'REPEAT ABOVE FOR EACH BUTTON, WITH DIFFERENT TOUCH=
RETURN@CHECKTOUCH'(THIS IS CALLED INTO AFTER GETTOUCH)
IF !TOUCH THEN RETURN
IF TOUCH==1 THEN GOTO @BUTTON1'(make sure button 1 has return, it will return to where checktouch was called)
'REPEAT ABOVE FOR EACH BUTTON'S TOUCH==

I use two subs so save time when there is no touch, it will only fall through the entire sub if it has to.