Forums

Topic: Petit Computer

Posts 761 to 780 of 9,620

Sprite

mines 1075 1228 4183

I'm not saying let's kill all the stupid people, I'm just saying let's take off the warning labels, and see what happens.
Friend Code: 1075-1228-4183

steriaca

Wheels2050 wrote:

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.

My Friend Code is 3368-1310-0690.

Discostew

ramstrong wrote:

Suddenly Discostew's idea makes great sense! Ever heard of tab-delimited format?

BTW, Discostew, you would use sophisticated algorithm on a simple problem. Parser and all. Writing program without a computer. You're a Software Engineer in real life, right?

Bachelors in Computer Science at the very least. I've actually done quite a bit with the DevkitPro homebrew toolkit for the GBA and DS prior to this.

Discostew

3DS Friend Code: 4425-1477-0127 | Nintendo Network ID: Discostew

Sprite

@portealmario my friend code is two posts above

I'm not saying let's kill all the stupid people, I'm just saying let's take off the warning labels, and see what happens.
Friend Code: 1075-1228-4183

ramstrong

Morphtroid wrote:

@Ramstrong: It is "harder and slower" compared to using mem

Is that right? Well, why don't you update your Petit Block using this technique and see for yourself.

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Eel

Maybe later when I add survival mode.

BTW, by "Harder and slower" I talk about a programming point of view, it takes more taps to program that compared to using mem.

Edited on by Eel

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

Shadow1364

@Morphtroid- What do you mean by survival mode on petit blocks if it only creats 3d blocks?

@Ramstrong- Could you be a bit more polite when talking to people on the forums? Your being very borderline rude...

FC: 1934-1622-0902

tiger667

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.

tiger667

Eel

@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.

Edited on by Eel

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

steriaca

I final have an ideal for project 2. An improvment on my Bomb program. Then, prehaps a quick little game based on the ideal of "Lady & The Tiger"...pick a door, and try not to get ate.

For my first major game, I seteled on the name "Applecatch". But, how would I begin the 'apple drop from top of screen to the bottom of the screen'? Any ideals?

My Friend Code is 3368-1310-0690.

tiger667

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)

tiger667

Eel

tchx and tchy will always show the X and Y where the stylus is touching in relation to the screen itself (255 and 191), moving the graphical layers around has no effect on them.

Just like with sprites.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

bloodofgore

I'm having alot of trouble with saving as a MEM file.

INPUT "";P$

P$=STR$(NOTE)
SAVE "MEM:NOTE"

I'm trying to save a string of text, can someone help me out?

bloodofgore

Eel

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.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

bloodofgore

Aight so I have this

INPUT "";P$

MEM$=P$
SAVE "MEM:NOTE"

If I write a file, then save it, it will load. But if I close the program, I loaded the file back up and nothing came back.

bloodofgore

bloodofgore

Another question, how do I make buttons that can be activated with the stylus?

bloodofgore

Eel

Are you loading it like:
LOAD"MEM:NOTE"
?

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.

Bloop.

<My slightly less dead youtube channel>

SMM2 Maker ID: 69R-F81-NLG

My Nintendo: Abgarok | Nintendo Network ID: Abgarok

tiger667

@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.

tiger667

portealmario

How do you delet files in the "write program" mode?

meng 😐
3ds friend code:1762-2769-7142

Please login or sign up to reply to this topic