DSiWare Forum

Topic: Petit Computer

Showing 6,601 to 6,620 of 9,489

AuthorMessage
Avatar

iprice

6,601. Posted:

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.

AuthorMessage
Avatar

TAINT_Zzyex

6,602. Posted:

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

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

Twitter: MetricCat

AuthorMessage
Avatar

ShadowGame

6,603. Posted:

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

AuthorMessage
Avatar

mystman12

6,604. Posted:

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 don't believe it! I won't believe it! There isn't a pinball right here! What kind of world do we live in, where there isn't a pinball right here? Well, I'm going to do my part! I'm gonna— umm... build a pinball! - Homestar Runner (Sort of)
Future Pinball blog
Infinite Office for PTC!

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

AuthorMessage
Avatar

TAINT_Zzyex

6,605. Posted:

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: MetricCat

AuthorMessage
Avatar

damolii

6,606. Posted:

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

AuthorMessage
Avatar

mystman12

6,607. Posted:

@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 don't believe it! I won't believe it! There isn't a pinball right here! What kind of world do we live in, where there isn't a pinball right here? Well, I'm going to do my part! I'm gonna— umm... build a pinball! - Homestar Runner (Sort of)
Future Pinball blog
Infinite Office for PTC!

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

AuthorMessage
Avatar

ramstrong

6,608. Posted:

IAmAPerson wrote:

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

Are you doing it manually, and pixel accurate? I find it helps tremendously to just use 24x24 grid. So you'll have 8x11 keypad. Then it's a simple matter of

KEY=FLOOR(TCHY/24)*11+FLOOR(TCHX/24)

Obviously, you don't use every key. I don't use the rightmost keys (because they're cut in half). :)
Edit:
You can combine this technique with either array of strings denoting label, then GOTO labelstring
or what I'd do is just use a string filled with characters denoting the keys, and use MID$ to extract the key. Modifying the keys is just as easy as changing the string.

@ShadowGame
Sorry to be pedantic, but I think you mean "spawn" instead of that, uh, bad word. Better check your dictionary to make sure.

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

AuthorMessage
Avatar

Xtremetdifan

6,609. Posted:

@randomous Im just wondering have you looked at green hill zone theme?

Must beat in Pokemon battle, checklist:
*
*
*

3DS Friend Code: 4124-5259-4542

AuthorMessage
Avatar

randomous

6,610. Posted:

@Xtremetdifan Oh, I'm sorry! I never said, did I? Well, I did look at it, and as much as I like the theme, I don't think I'll be able to reproduce it well. I'd have to create some custom sound effects to get that sort of "Sega" sound, and I just don't think I could. I'm sorry.

randomous

AuthorMessage
Avatar

Xtremetdifan

6,611. Posted:

randomous wrote:

@Xtremetdifan Oh, I'm sorry! I never said, did I? Well, I did look at it, and as much as I like the theme, I don't think I'll be able to reproduce it well. I'd have to create some custom sound effects to get that sort of "Sega" sound, and I just don't think I could. I'm sorry.

Oh it's cool, I'll just use some of the pre-set music...sigh... Thanks for checking it out though!

Must beat in Pokemon battle, checklist:
*
*
*

3DS Friend Code: 4124-5259-4542

AuthorMessage
Avatar

Slayer

6,612. Posted:

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!

Everything. I'm in it for the aftermath results.

"Hello sir, may I take your order?"
"Yes, I'll have a cheeseburger and fries..."
"I AM the cheeseburger and fries!"
Things you need to know about me:
I hate Texas.

AuthorMessage
Avatar

ramstrong

6,613. Posted:

0Games wrote:

IAmAPerson wrote:

What is you guys' LEAST favourite part of PTC programming? (snip)

Everything. I'm in it for the aftermath results.

A programmer would never say that. Maybe you should change your tag line signature to something more appropriate.

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

InsertPi

6,614. Posted:

@ramstrong I do this: I touch the top-left and bottom-right of each button, record the TCHX and TCHY values of both presses, then I do something like this:
IF TCHX>10 AND TCHY> 10 AND TCHX<20 AND TCHY<20 THEN @EATPOTATO

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: @PhilLovesPi

AuthorMessage
Avatar

ramstrong

6,615. Posted:

IAmAPerson wrote:

@ramstrong I do this: I touch the top-left and bottom-right of each button, record the TCHX and TCHY values of both presses, then I do something like this:
IF TCHX>10 AND TCHY> 10 AND TCHX<20 AND TCHY<20 THEN @EATPOTATO

For each button? No wonder it takes a long time. Hmmm. Maybe I should expedite that Virtual Keyboard blogpost I'd been meaning to write. Trust me. If you can go by grid, do it by grid. It won't take any time at all.

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

twinArmageddons

6,616. Posted:

i just released version 0.05 of my attack on titan game c:
http://petitcomputer.wikia.com/wiki/Attack_on_Titan_Tribute_Game
i added a limited amount of swords, swords can break if you hit titans too much, better 3dmg physics, left attacking, scrolling background, respawning after you die, easier to hit the titans, and an option to change the music volume
it's still very buggy though

get in loser we're going titan hunting

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

AuthorMessage
Avatar

ramstrong

6,617. Posted:

twinArmageddons wrote:

it's still very buggy though

Let me know when the bugs are gone, and I'll give it a try. ;) Can you post pics in the meantime?

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

Let's just call a spade, a spade.

3DS Friend Code: 1091-7596-4855

AuthorMessage
Avatar

twinArmageddons

6,618. Posted:

ramstrong wrote:

Can you post pics in the meantime?

Untitled
this is an early picture before i added titans and i started messing around with the physics

get in loser we're going titan hunting

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

AuthorMessage
Avatar

ShadowGame

6,619. Posted:

Thanks for your helping and sorry for the mistake with
spawn. I have another question:
I would make Level 2 in my game.
I would make 2 enemies in this Level.
The Problem is: how can i Check the collision
With sprite 4 (sprite 4 is a shoot that kills
the enemies.) and the two Enemy sprites (4 and 7)?
And how can i make the sprites to move?

Sorry for so much questions

ShadowGame

AuthorMessage
Avatar

GraphicGenius

6,620. Posted:

IAmAPerson wrote:

@ramstrong I do this: I touch the top-left and bottom-right of each button, record the TCHX and TCHY values of both presses, then I do something like this:
IF TCHX>10 AND TCHY> 10 AND TCHX<20 AND TCHY<20 THEN @EATPOTATO

That's what I usually do too. And WOW these forums are slow.

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