Forums

Topic: Petit Computer

Posts 6,181 to 6,200 of 9,620

TAINT_Zzyex

on a totaly unrealated note i cant get button commands working in terrarium.
i have
@loop
print "press x to open inventory
IF BUTTON==()64 GOTO @INV
wait 120
@INV

it goes to @inv anyways button or not! how do i fix this. i tryed else goto @loop but that just freaked it out

Edited on by theblackdragon

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

InsertPi

@Zzyex

PRINT "Press X to open your backpack (or whatever you want)"
@LOOP
IF BUTTON()==64 THEN @INV
GOTO @LOOP

or if you want to have it to open whenever he wants to even if other stuff is going:

@MAINLOOP
IF BUTTON()==64 THEN GOSUB @INV
GOSUB @DRAWBG
GOSUB @DRAWSPRITES
GOSUB @MOVE
'Or whatever is in your program
GOTO @MAINLOOP

Edited on by InsertPi

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

TAINT_Zzyex

IAmAPerson wrote:

@Zzyex

PRINT "Press X to open your backpack (or whatever you want)"
@LOOP
IF BUTTON()==64 THEN @INV
GOTO @LOOP

or if you want to have it to open whenever he wants to even if other stuff is going:

@MAINLOOP
IF BUTTON()==64 THEN GOSUB @INV
GOSUB @DRAWBG
GOSUB @DRAWSPRITES
GOSUB @MOVE
'Or whatever is in your program
GOTO @MAINLOOP

@iamaperson says SYNTEX ERROR when i do
IF BUTTON()==64 GOSUB @INV
Witch was the first problem i had a syntex error for what should be correct. also i dont get the second option... ps i have no movement yet im starting with opening inventory and telling it what items to display i do have it part of the main game loop tho

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

Discostew

Having an IF statement leading straight to a GOTO statement does not require the THEN keyword. Everything else, including GOSUB, requires it.

Discostew

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

TAINT_Zzyex

Discostew wrote:

Having an IF statement leading straight to a GOTO statement does not require the THEN keyword. Everything else, including GOSUB, requires it.

didnt work with then ..............................................
also a second problem the bg and the sprites are on a different color scheme how do i connect bg color with bg and sprite color with sprites #desperate

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

Miblon

ramstrong wrote:

Miblon wrote:

I'm making a game called Boy Flinger using Ramstrong's Sprite Collision source code in the tutorial thread (thanks ramstrong!) It has a background, the witch is replaced with a skeleton, and there's a score and a count for boy's flung. Here are the features I'm planning (or don't know how to program)-
-The boys don't go after you, instead they go for a chest or something
-Getting rid of the keyboard for the touch screen
-Animation for the boys

Cool! Can't wait to see it.
I was wondering which piece, then I realize the name is Boy Flinger. Ha! I know exactly which one it is! If you're not using the witch as the player sprite, maybe you can plant a few of them with different pallette color and use them as target instead of chests. Or is that too politically incorrect where you live?

EDIT
How many pages for today? Ugh. Double and Triple posts.

I'm still working on it really, and most of the stuff I don't know how to do. Could you give me some code for a chest and the boys following it?
Also, here are some more features I want in:
-Waves
-New areas
-Extra enemies
-A life system
-If I ever get there, a shop

This isn't a interesting signature. Go look at someone elses.
Friend Code: 5370-0889-8930

TAINT_Zzyex

no chest sprite... you need to make your own otherewise use the petit computer tutoriol thread. its your game not ours. the ocasional thing such as when something should work but dosnt or has no answer on the tutorial thread is all you should ask. we want to see a game YOU made, not one many people made and you put together.
anyways... good luck

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

Discostew

TAINT_Zzyex wrote:

Discostew wrote:

Having an IF statement leading straight to a GOTO statement does not require the THEN keyword. Everything else, including GOSUB, requires it.

didnt work with then ..............................................
also a second problem the bg and the sprites are on a different color scheme how do i connect bg color with bg and sprite color with sprites #desperate

Do you have it like @IAmAPerson showed?

IF BUTTON()==64 THEN GOSUB @INV

This line works fine for me.

BG color is automatically assigned to BG layers, as are sprite color with sprites. It's a matter of assigning them with their respective functions. You set which palette slot (0-15) with BGs when you set down tiles onto the layers with BGPUT. With sprites, you assign the palette slot (0-15) with SPSET, or if you already have a sprite set, with SPCHR. The in-app manual, as well as the website manual, show how these work.

Discostew

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

ramstrong

TAINT_Zzyex wrote:

no chest sprite... (snip) we want to see a game YOU made, not one many people made and you put together.

Ignore Zzyex. Chest sprites are 56 + 57 on the sprite sheet. Also, there's plenty of group projects around. For all the other info, those are rather advanced topics, so work on them one at a time. I do have WITCH 0.5 game framework that showcases all the relevant piece for a sprite-based game. It's on the tutorial page somewhere near the end. If you have any questions, just ask it here.

PS: Witch have syntax error? Considering that comes in QR, I'd sooner think you made the mistake than Petit Computer scanned the QR wrong.

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

TAINT_Zzyex

Discostew wrote:

TAINT_Zzyex wrote:

Discostew wrote:

Having an IF statement leading straight to a GOTO statement does not require the THEN keyword. Everything else, including GOSUB, requires it.

didnt work with then ..............................................
also a second problem the bg and the sprites are on a different color scheme how do i connect bg color with bg and sprite color with sprites #desperate

Do you have it like @IAmAPerson showed?

IF BUTTON()==64 THEN GOSUB @INV

This line works fine for me.

BG color is automatically assigned to BG layers, as are sprite color with sprites. It's a matter of assigning them with their respective functions. You set which palette slot (0-15) with BGs when you set down tiles onto the layers with BGPUT. With sprites, you assign the palette slot (0-15) with SPSET, or if you already have a sprite set, with SPCHR. The in-app manual, as well as the website manual, show how these work.

im useing SCU files for the back ground i have
LOAD"BGU0:TERRA
LOAD"COL1:TERRA
LOAD"SCU0:T
LOAD"SCU1:T1
LOAD"COL0:THEAD
LOAD"SPU1:THEAD
'When i load it puts the preset background i made in. but then it changes my background color with my sprite color. couldnt find how to fix this on that site...

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

Pixelrobin

Hopefully , PTC 3D will have better error handling. They could have made it something like:
Error at line ** (IF): Expected THEN, etc but found (stuff found instead).

Syntax coloring would be a really nice addition as well.

Oh and a "Check Syntax" button. Because some of us coughramstrongcough forget to test your final product to the core.

Edited on by Pixelrobin

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Discostew

TAINT_Zzyex wrote:

im useing SCU files for the back ground i have
LOAD"BGU0:TERRA
LOAD"COL1:TERRA
LOAD"SCU0:T
LOAD"SCU1:T1
LOAD"COL0:THEAD
LOAD"SPU1:THEAD
'When i load it puts the preset background i made in. but then it changes my background color with my sprite color. couldnt find how to fix this on that site...

COL0 designates BG color. COL1 designates SPR color. COL2 designates GRP color.

Edited on by Discostew

Discostew

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

TAINT_Zzyex

thanks @discostew but buttons still dont work

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

Miblon

@Ramstrong
Thanks for the info. I'll keep it in my mind.

Edited on by Miblon

This isn't a interesting signature. Go look at someone elses.
Friend Code: 5370-0889-8930

ramstrong

Miblon wrote:

@Ramstrong
Thanks for the info. I'll keep it in my mind.

No problem. On the WITCH game, once the skeletons reached the bottom, they'll chase the witch. Just adapt that to your chest chasing boys algorithm. HTH.

TAINT_Zzyex wrote:

thanks @discostew but buttons still dont work

Plenty of info on how to read buttons on the Tutorial thread! I suggest you read those pages. Don't expect us to debug your mythical program. No one can help you if you simply say "buttons don't work!" with no explanation whatsoever.

Here's a hint: It works for me.

Edited on by ramstrong

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Discostew

TAINT_Zzyex wrote:

thanks @discostew but buttons still dont work

Are you using VSYNC once per loop? I notice the actual IF statement is basing the input with == rather than AND. With ==, if you're pressing any other button and/or DPad direction while pressing the one you specify (64 correlates to the X button), it will not work. You need to be more specific than saying that it doesn't work. You need to give us details, like how is it not working, what errors is displaying if any.... That sort of stuff. Without specifics, we're just as much in the dark as you are.

Discostew

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

ramstrong

Bluerobin2 wrote:

Oh and a "Check Syntax" button. Because some of us coughramstrongcough forget to test your final product to the core.

Bah. Beta Testing is for sissies. Us real men read code for correctness!
Anyway, NASA made the same mistake I did. Mistyping + for -.

Edited on by ramstrong

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Pixelrobin

@ramstrong I know testing is for sissies, but you have to remember that you're pecking at a tiny little keyboard. But I see your point. Is that how NASA dixcovered the layers underneath the earth?

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

ramstrong

Bluerobin2 wrote:

@ramstrong I know testing is for sissies, but you have to remember that you're pecking at a tiny little keyboard. But I see your point. Is that how NASA dixcovered the layers underneath the earth?

Alpha Test=programmer
Beta Test=Tester not programmer, not consumer
Since I work alone, no beta tester for me.
That's why I got an XL.
Petit Computer Keyboard

I'm actually fuzzy whether that's a minus sign, or a horizontal-bar (average) sign. So it's either rocket flip, or out-of-bound oscillation. The point is, it's semantic error, not syntax error! So, syntax checker won't catch it.

Edited on by ramstrong

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

InsertPi

Oops. I forgot for a split second •derp• that it is preferred you either do:
B=BUTTON()
IF B AND 64 ...
or
IF BUTTON() AND 64
instead of
IF BUTTON()==64
Thanks @Discostew for reminding me. •worst brain fart ever•

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Please login or sign up to reply to this topic