Forums

Topic: Petit Computer

Posts 6,581 to 6,600 of 9,620

InsertPi

@ShadowGame I see you're doing

IF STUFF THEN STUFF ELSE THEN STUFF RETURN

If you're using ELSE, then you don't use another THEN after that

IF STUFF THEN STUFF ELSE STUFF

So you'd do

IF STEPS==0 THEN GOTO @LOSE ELSE GOTO @LOOP2

or for short

IF STEPS==0 THEN @LOSE ELSE GOTO @LOOP2

I don't know what you want the RETURN to do. Is it like an END IF, cause that's not required in this language. Have you programmed in other languages in the past? This reminds me of a few other languages I've used before.

Also, I saw before that you did

IF MOVE==U...

MOVE in this case is a variable. If you're using the D-pad, then you would use

IF BUTTON() AND 1 THEN...

This means that if up is pressed, it'll execute whatever is after the THEN. 2 is down, 4 is left, 8 is right, and it continues like this from A, B, X, Y, L, R, START, and SELECT, doubling each time. If you want MOVE as a string, then you'd use

IF MOVE$=="U" THEN...

A $ after the variable indicates that it's a string.

If you have anymore questions, just ask!

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:

ShadowGame

Thanks!!!
And yes i have got another question:
How can i make that the enemy sporn on a random place?
I used:
SPAWN=RND(3)
IF SPAWN==1 THEN RETURN
And then i used SPSET, SPOFS and SPANIM.

But there is always an error:
RETURN WITHOUT GOSUB
and when i added Gosub there was an error that GOSUB is wrong...

I used the code from the game WIZARD.

Please Help!
Thanks

ShadowGame

mystman12

@ShadowGame It sounds like you're putting a RETURN command somewhere that isn't in a GOSUB. RETURN should only be used when you use the GOSUB command, like this:

GOSUB @YAY
Print " AWESOME"

@YAY
PRINT" THIS IS "
RETURN

This code will print THIS IS AWESOME on the screen. What's happening is the when the program gets to the GOSUB command it travels to the @YAY. Once it hits RETURN, it goes back to the GOSUB and starts reading code from there. I hope this helps!

Edited on by mystman12

I like makin' games!
Future Pinball games!
Petit Computer games!!
and SmileBASIC games!
Waiting for Kirby Air Ride 2. One day, it will come. One day...

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

ShadowGame

OK, thanks.
But: In Wizard (a game that i have from petit computer wikia) is the same code and there it works....

ShadowGame

InsertPi

ShadowGame wrote:

In Wizard (a game that i have from petit computer wikia) is the same code and there it works....

Any game that has GOSUB and RETURN correctly then it'll work.

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:

Pootrick2

@ProgrammerPro work on link moving around and the background moving when you go to another screen

Edited on by Pootrick2

I LOVE petit computer AND anything Zelda/Minecraft related (i own all zelda games)

3DS FC=0919-9700-5328

3DS Friend Code: 0919-9700-5328 | Nintendo Network ID: Pootrick2 | Twitter:

Discostew

GOSUB should always precede RETURN in the code execution.

Discostew

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

ShadowGame

Ok, thanks.
How can i make that the Enemy sprite Spawn on random places (or make a random that chooses 1 of 5 or more places)?

And how i can blit my own sprites on the screen?
I know how i can make them and i can Load them
but how can i blit them on the screen? And how can i blit sprites on the touchscreen (i know how i
can blit Backgrounds on the screen, but not how i Must so this with sprites)?
Thanks

Edited on by ShadowGame

ShadowGame

InsertPi

What is you guys' LEAST favourite part of PTC programming? Mine is doing touch screen buttons. Making the touch controls for Minecraft DS is a NIGHTMARE!

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:

GraphicGenius

You know what @Pootrick2 I'm just gonna work on the profile selection because it's gonna be a while before we start working on the actual game.

IAmAPerson wrote:

What is you guys' LEAST favourite part of PTC programming? Mine is doing touch screen buttons. Making the touch controls for Minecraft DS is a NIGHTMARE!

Yeah kinda the same thing for me. Also, I'm sorry I don't know much about MCDS. It's just that the last time I got the program was 5 or 6 updates ago! Do you have any link to the qr codes for the latest update?

Edited on by GraphicGenius

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. Wait was that just a joke?

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

twinArmageddons

IAmAPerson wrote:

What is you guys' LEAST favourite part of PTC programming? Mine is doing touch screen buttons. Making the touch controls for Minecraft DS is a NIGHTMARE!

what i do for touch screen controls is write this in the prg
CLS:?TCHX:?TCHY
and write down the coordinates and when im done i remove that line

get in loser we're going titan hunting

3DS Friend Code: 2879-0639-8952 | Nintendo Network ID: merp_aottg

InsertPi

@programmerpro http://petitcomputer.wikia.com/wiki/Minecraft_DS
@twinArmageddons I do that too, it's just so time consuming when you have a ton of buttons.

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:

iprice

ShadowGame wrote:

Ok, thanks.
How can i make that the Enemy sprite Sporn on random places (or make a random that chooses 1 of 5 or more places)?

And how i can blit my own sprites on the screen?
I know how i can make them and i can Load them
but how can i blit them on the screen? And how can i blit sprites on the touchscreen (i know how i
can blit Backgrounds on the screen, but not how i Must so this with sprites)?
Thanks

To create a sprite at a random location you first have to load a sprite image file, then use SPSET to create a sprite, then use SPOFS to display it at the required location.

eg
ACLS
SPCLR

X=100
Y=100
SPSET 0,10,0,0,0,0
' 0=sprite number. Each new sprite needs to have a unique number
' 10 is the actual sprite graphic image number
' The first zero is the palette number. The other values are horizontal and vertical rotation values, then the layer of the screen. Optional parameters are size x and size y (8, 16, 32 etc.)

@LOOP

SPOFS 0,X,Y
' Draws sprite number zero at position 100,100 on the top screen

' If you want to draw a sprite on the bottom screen you need to use SPAGE 1 before using the SPOFS command. Be aware you can only draw system sprites on the bottom screen, not ones you've designed yourself IIRC

GOTO @LOOP
.
.
.
.
.
For a number of random sprites you can do something like this -

ACLS
SPCLR
CLEAR

GOTO @INIT

@INIT

DIM SPRITEX(10)
DIM SPRITEY(10)

FOR N=0 TO 9
SPRITEX(N)=RND(255)
SPRITEY(N)=RND(180)
SPSET N,10,0,0,0,0
NEXT

GOTO @LOOP

@LOOP

FOR N=0 TO 9
SPOFS N,SPRITEX(N),SPRITEY(N)
NEXT

GOTO @LOOP

That will create and display10 sprites all using sprite image number 10 at random positions on the top screen.

Edited on by iprice

I code, therefore I am.

ShadowGame

Thanks iprice!

I have a question:
At my Game i would add Level 2.
But i would make 2 enemies. So i must use
a code for collision for the two sprites. How i Must do this?
I Hope you can understand this, but im not so good at
English, because my Nationality Isnt England.

And: How can i load two own sprites? If
I load two, then Player and Enemy habe the Same sprite
And yes i use spu0 and spu1.
Thanks

Edited on by ShadowGame

ShadowGame

mystman12

I finished some of the basics of my game. I have a maze, and a character that can walk around in it, and it's WAY better than the previous version I released. The game is an arcade game called Infinite Office: Starring Joe Biggle, and it's about Joe Biggle (The character you play as) trying to save his wife, Mimi, from some robots she invented that went rogue. And they're ALL the way at the top! You have to get as high up in the building as you can. The game will have 4 stages, which are repeated over and over again, and it will have levels, which is the total amount of stages you've completed. As the level gets higher, the game the gets harder. I hope to give each stage unique enemies/elements too. I'm not going to tell how to get higher in the building yet, because it's the main game play element of the whole game, but I'll probably start working on that next. That's the plan, hopefully I'll be able to make it. Here are the QR codes in case anyone's interested.

The Program:
Untitled
The Background Tiles:
Untitled
The Sprites:
Untitled

Btw, I put some of you guys in the credits for all the help you've given me. If you don't want to be in there for any reason, just tell me. Holding select when you start the game brings up the operator's menu, where you can view the credits. (Thanks for the tutorial, ChangeV!) Just tell me if you'd like me to keep posting QR codes.

I like makin' games!
Future Pinball games!
Petit Computer games!!
and SmileBASIC games!
Waiting for Kirby Air Ride 2. One day, it will come. One day...

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

TAINT_Zzyex

if ya need more spriting just ask bro

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

Twitter:

damolii

TAINT_Zzyex wrote:

http://petitcomputer.wikia.com/wiki/Trpg can someone fix movement on this you need the sprites. http://petitcomputer.wikia.com/wiki/RPG_Sprites.

Never mix GOTO and GOSUB in the same place. They will cancel each other. You are using GOSUB to head to the direction routine, but you're using GOTO for the @GAMELOOP. Don't do that. It causes a paradox. I don't really remember enough so I can tell you exactly what to do (I use background scrolling), but don't mix those two !!!! >->

Edited on by damolii

I don't have a 3DS so what do I put here? -Damolii

mystman12

@TAINT_Zzyex Thanks for offering! I'm going for a simple old arcade game look, so I should be able to do the sprites just fine, but if I really need help, I'll be sure to ask.

Does anyone know how I can keep track of time in the background? Instead of using WAIT and stopping everything. Would I have to use a variable that counts down every frame, or is there a command for it?

I like makin' games!
Future Pinball games!
Petit Computer games!!
and SmileBASIC games!
Waiting for Kirby Air Ride 2. One day, it will come. One day...

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

Please login or sign up to reply to this topic