Forums

Topic: Petit Computer

Posts 4,881 to 4,900 of 9,620

ramstrong

Hairmanban19 wrote:

I don't know what to do with Petit Computer anymore. I wish i could make better games than text games,i just have no idea how,and i don't what to ask because i've never programmed a language before. So i have no idea what to ask to help me figure out how to make non text games.

Start making sprite games. Read help file on sprites, take a look at my witch game, and see if you can do any of the challenges!

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

noxuss

Hairmanban19 wrote:

I don't know what to do with Petit Computer anymore. I wish i could make better games than text games,i just have no idea how,and i don't what to ask because i've never programmed a language before. So i have no idea what to ask to help me figure out how to make non text games.

What I did, was set myself a goal to make a character walk, using SPSET, SPOFS, and SPANIM.

noxuss

noxuss

slayer wrote:

Ah, too much delay. I was playing Phantom Hourglass for a bit, I might download Dragon Quest and/or Final Fantasy. I prefer Final Fantasy, but everyone loves Dragon Quest IX and IV. I will get to SPANIM stuff now, how exactly do I load a CUSTOM sprite? Not one of those default ones-custom.

I think it depends on where you saved it, usually something like LOAD "SPU0:FILENAME" or LOAD "SPU1:FILENAME"

EDIT: sorry for the double posts guys :c

Edited on by noxuss

noxuss

Hairmanban19

ramstrong wrote:

Hairmanban19 wrote:

I don't know what to do with Petit Computer anymore. I wish i could make better games than text games,i just have no idea how,and i don't what to ask because i've never programmed a language before. So i have no idea what to ask to help me figure out how to make non text games.

Start making sprite games. Read help file on sprites, take a look at my witch game, and see if you can do any of the challenges!

Thats what i want to do but i have no idea how! Here are the commands i know how to use:PRINT,CLS,GOTO,WAIT,BGMPLAY,BGMSTOP,INPUT,and BEEP.

Edited on by Hairmanban19

...

3DS Friend Code: 3136-7615-5907

Slayer

noxuss wrote:

slayer wrote:

Ah, too much delay. I was playing Phantom Hourglass for a bit, I might download Dragon Quest and/or Final Fantasy. I prefer Final Fantasy, but everyone loves Dragon Quest IX and IV. I will get to SPANIM stuff now, how exactly do I load a CUSTOM sprite? Not one of those default ones-custom.

I think it depends on where you saved it, usually something like LOAD "SPU0:FILENAME" or LOAD "SPU1:FILENAME"

EDIT: sorry for the double posts guys :c

Okay, thanks. And double posts don't matter, at least not much. I do it at times. Anyway, noxuss are you making a game? You should, you have enough knowledge about SmileBASIC.

I have nothing really to say about myself.

Slayer

Hairmanban19 wrote:

ramstrong wrote:

Hairmanban19 wrote:

I don't know what to do with Petit Computer anymore. I wish i could make better games than text games,i just have no idea how,and i don't what to ask because i've never programmed a language before. So i have no idea what to ask to help me figure out how to make non text games.

Start making sprite games. Read help file on sprites, take a look at my witch game, and see if you can do any of the challenges!

Thats what i want to do but i have no idea how! Here are the commands i know how to use:PRINT,CLS,GOTO,WAIT,BGMPLAY,BGMSTOP,INPUT,and BEEP.

For SPSET all you have to do is put six numbers, of location, and the sprite itself. But the sprite itself means loading the default sprites for Petit Computer, note that.
Example:
SPSET 0,6,0,0,0,0
Try this, and you will see a sprite appear on-screen. This is only how to set a sprite. Others can explain better, and you are free to mess with the numbers to get a better understanding of this.
EDIT: You might see a sprite onscreen, but to learn this language well, check out this link:
http://www.snailfacia.net/PTCguide/index.html#BTRIG

Edited on by Slayer

I have nothing really to say about myself.

Slayer

Aah! Custom sprites are difficult... I tried this:
LOCATE 1,12
LOAD "SPU0:MAGES1"
Just to see which direction 1 and 2 I put because I didn't remember, I used a Mage sprite I prepared, and when I put this in edit, and ran the program, it just put a load of space in between RUN and OK. I didn't even see the sprite!
Once more, GG Petit Computer...
Anyone have help with this?

Edited on by Slayer

I have nothing really to say about myself.

Pixelrobin

@hairmanban19
Other than that;

SPOFS sprite number, x position, y position, number of frames

changes the sprite position

SPANIM sprite number, number of frames, speed (60 = 1 sec)

animates the sprite

Those are the bare basics of controlling a sprite

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

Slayer

This avatar might be temporary... It doesn't fit the picture space I have...

I have nothing really to say about myself.

Slayer

Better. Now, @Bluerobin2, when I run the program after successfully loading the sprite apparently, says SPOFS is an illegal function call.

I have nothing really to say about myself.

noxuss

slayer wrote:

Better. Now, @Bluerobin2, when I run the program after successfully loading the sprite apparently, says SPOFS is an illegal function call.

You're probably using SPOFS before the SPRITE has actually been loaded in the game (or has been deleted). Thanks, but I don't have enough knowledge, I need to understand arrays and data then I might try .

noxuss

Slayer

noxuss wrote:

slayer wrote:

Better. Now, @Bluerobin2, when I run the program after successfully loading the sprite apparently, says SPOFS is an illegal function call.

You're probably using SPOFS before the SPRITE has actually been loaded in the game (or has been deleted). Thanks, but I don't have enough knowledge, I need to understand arrays and data then I might try .

I'm using this:
LOAD"SPU0:MAGES1"
SPOFS 0,5,16,3
So I'm using SPOFS after the actual sprite is loaded.
I don't know how to use data, idk about arrays, and you see me making two games at once and succeeding.
In progress, though.

Edited on by Slayer

I have nothing really to say about myself.

noxuss

slayer wrote:

noxuss wrote:

slayer wrote:

Better. Now, @Bluerobin2, when I run the program after successfully loading the sprite apparently, says SPOFS is an illegal function call.

You're probably using SPOFS before the SPRITE has actually been loaded in the game (or has been deleted). Thanks, but I don't have enough knowledge, I need to understand arrays and data then I might try .

I'm using this:
LOAD"SPU0:MAGES1"
SPOFS 0,5,16,3
So I'm using SPOFS after the actual sprite is loaded.
I don't know how to use data, idk about arrays, and you see me making two games at once and succeeding.
In progress, though.

Ohhh I see what's wrong. When you load the sprite, it loads the whole sprite sheet.

For instance, the default character number for the boy is 64.
Say you edited the chred and changed the boy into, say, a frog. Whatever you saved the chred as (in this case, I'll call it ANIMALS) it would be loaded as
LOAD "SPU0:ANIMALS"
SPSET 0,64,0,0,0,0

^ The load command doesn't load an individual sprite, but all of the edited sprites as a whole, if that clears anything up.

noxuss

InsertPi

@Hairmanban19
Here's a few graphic commands:

GCLS

Clears all graphics

GPAGE (0 for top, 1 for bottom, 2 for invisible)

Tells PTCom where you'd like to draw

GCOLOR (colour)

Sets the colour you'd like to draw in

GPSET X,Y[,COLOUR]

Puts a dot on the screen. NOTE: Brackets mean that that part of the command is optional

GLINE X START,Y START,X END,Y END[,COLOUR]

Makes a line

GCIRCLE X,Y,RADIUS[,COLOUR]

Makes a circle

GBOX X TOP-LEFT,Y TOP-LEFT,X BOTTOM-RIGHT,Y BOTTOM-RIGHT[,COLOUR]

Makes a box

GSPOIT X,Y

Gets colour from a set point on the screen

Some more commands:

IF <condition> THEN <what to do> [ELSE <what to do>]

Will execute a command if something is how you like it
Syntax:

== means "equals" (Can use for variables and strings)
!= means "not equals" (Can use for variables and strings)
> means "greater than" (only variables)
< means "less than" (only variables)
>= means "greater than or equal to" (only variables)
<= means "less than or equal to" (only variables)
Example:
INPUT VAR
IF VAR<0 THEN PRINT "The number is negative" ELSE PRINT"The number is positive"
or...
INPUT STRING$
IF STRING$=="Hi" THEN GOTO @HI (For gotos, ou don't have to put GOTO. You can just put [...THEN @HI...])

MID$(STRING,POSITION IN STRING,NUMBER OF CHARACTERS INSPECTED)

Used to inspect a string. Example:
STRING$="Test string"
LETTERS$=MID$(STRING$,1,2)
PRINT LETTERS$
The output would be "es". It inspects 2 characters past point 1 in the string.
REMEMBER: First place in the string is actually 0. Second is 1, and so on

LEN(STRING$)

Gets the length of a string

STR$(VARIABLE)

Gets the string value of a variable

VAL(STRING$)

Gets the numeric value of a string
Ask if you wish for more

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:

noxuss

Anyone have a tutorial for making walls/collision? I made a SCR, which has trees and stuff on the outside, and I was wondering how to stop the player from going through the trees.

noxuss

randomous

Bah, tried to make another Tron song. Still doesn't sound like Tron... and worst of all, this one sounds incomplete. Oh well, here you go:

Untitled

Feel free to use it, don't claim you made it, blah blah blah lol.

Edited on by randomous

randomous

InsertPi

@Hairmanban19 for the heck of it, I'll post some more just 'cause.

LINPUT [printed text;]String/Variable

Same as INPUT, it just doesn't put the "?"
Here's a slightly harder but very useful command:

FOR (variable)=(number) TO (number) [STEP (number)]
Commands here
NEXT

Makes a loop. It adds one (or the step value) to the variable each time it loops until the variable has met it's set max. I'll make an example:

FOR I=0 TO 10
PRINT I
NEXT

This will loop 10 times. Each time it loops (from the FOR to the NEXT), it adds 1 to I until it reaches 10. The output is:

0
1
2...

If I want to make it go up by 2 each time, then I do this:

FOR I=0 TO 10 STEP 2
PRINT I
NEXT

The output will be:

0
2
4...

I would post more, but it's getting late for me.

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:

Hairmanban19

Thanks for helping me out guys,i'll check out all of this stuff tomorrow!

...

3DS Friend Code: 3136-7615-5907

noxuss

IAmAPerson wrote:

@Hairmanban19 for the heck of it, I'll post some more just 'cause.

LINPUT [printed text;]String/Variable

Same as INPUT, it just doesn't put the "?"
Here's a slightly harder but very useful command:

FOR (variable)=(number) TO (number) [STEP (number)]
Commands here
NEXT

Makes a loop. It adds one (or the step value) to the variable each time it loops until the variable has met it's set max. I'll make an example:

FOR I=0 TO 10
PRINT I
NEXT

This will loop 10 times. Each time it loops (from the FOR to the NEXT), it adds 1 to I until it reaches 10. The output is:

0
1
2...

If I want to make it go up by 2 each time, then I do this:

FOR I=0 TO 10 STEP 2
PRINT I
NEXT

The output will be:

0
2
4...

I would post more, but it's getting late for me.

yesss, I'm understanding arrays now, thanks!

noxuss

ramstrong

Hairmanban19 wrote:

Thats what i want to do but i have no idea how! Here are the commands i know how to use:PRINT,CLS,GOTO,WAIT,BGMPLAY,BGMSTOP,INPUT,and BEEP.

'BOY ANIMATION - AUTOMATIC
SPSET 2,64,0,0,0,0,16,16:'Sets Boy Sprite
SPANIM 2,4,15:'Make it walk (animate)
SPOFS 2,0,0:'MOVE TO 0,0 (in 0 frames)
SPOFS 2,172,0,660:'MOVE TO 172,0 IN 660 FRAMES

Did you go over through the Tutorial thread? There's plenty of sprite tutorials there!

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

Please login or sign up to reply to this topic