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 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.
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...
@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:
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!
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.
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
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.
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?
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
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
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.
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.)
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 -
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
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:
The Background Tiles:
The Sprites:
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.
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 !!!! >->
@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?
Forums
Topic: Petit Computer
Posts 6,581 to 6,600 of 9,620
Please login or sign up to reply to this topic