Forums

Topic: Petit Computer

Posts 9,341 to 9,360 of 9,620

Discostew

It seems the author of Shovel Knight's music has made an NSF file containing all of the game's music (which means the music may have been originally composed with NES tools or even with Famitracker). This means I could technically replicate the music on PTC in the same way as I have with Megaman 2. It does use extra channels only available on the Famicom because of the VRC6 chip (which games like Castlevania 3 JP utilize), but these consist of 2 additional square/pulse generators and 1 sawtooth generator. The former are already available (PTC has access to all 4 of the DSi's pulse generators for our use), and the sawtooth generator should be easy to generate in much the same way a triangle wave is made.I'm not saying I'm going to make the music on PTC. Just saying it is technically possible.

Discostew

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

Pootrick2

Zane-dude wrote:

offtopic:
@IAmAPerson @bluerobin2 @pootrick2 @leviseljir is invited to help me finish a minecraft server im working on... but once its finished,I will release it to more populated forums but for now y'all will either test the minigames or help make them. so, your probibly thinking,"what's the server's name???" well I have the awnser.
it doesn't really have a name... so,yeah! ill tell you the adderess when I remember... o_o

Sure! But when and what time though?

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:

SquareFingers

zeldafoursword wrote:

I don't understand which command should I use BUTTON or BTRIG

First question: Are you sure you will be checking the button status only once per frame, and every frame? If the answer is no, then use BUTTON(). If the answer is yes, and you want to know the instant that a button is pressed (but you don't care how long the button is held down, it's only the moment that it gets pressed that you want), then use BTRIG.

If you want auto-repeat, research the command BREPEAT, and use BUTTON(1). If you want to know when the button is released, you can use BUTTON(3). But these two, again, are only useful if you know you're scanning only once per frame, and every frame. In case you're interested, BUTTON(2) is the same as BTRIG(), and BUTTON(0) is the same as BUTTON().

SquareFingers

Petitlife935

if I have a CHR by the name of SOLDIER how can I put that into my game and what SPSET would I use for the first spot and the second spot?

Petitlife935

Discostew

Petitlife935 wrote:

if I have a CHR by the name of SOLDIER how can I put that into my game and what SPSET would I use for the first spot and the second spot?

You use the LOAD command as such....

LOAD "SPUx:SOLDIER", FALSE

where "x" is a number between 0 and 7, inclusive
and the FALSE at the end is just to prevent the load dialog from popping up.

As for how to access them, each sprite slot has up to 64 reference points sequentially (0 to 63, inclusive), so loading a sprite sheet would require that you add to your index the formula (x * 64). So, for instance, if you loaded your sprite sheet into slot 4, you would add 256 to your overall index (x * 64) -> (4 * 64) -> (256). If you loaded into slot 0, you'd add 0 (or nothing at all).

Discostew

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

Petitlife935

How can I use LOCATE for SPSET
I am making a civil war stradegy game and I have a big map that takes up most of the screen but I made some sprites in CHRED and I want to know how to locate a sprite. here is the code for the example

ACLS:CLEAR
LOAD"SPU0:SOLDIER",FALSE
SPSET 0,0,0,0,0,1`

Edited on by Petitlife935

Petitlife935

Discostew

Petitlife935 wrote:

How can I use LOCATE for SPSET
I am making a civil war stradegy game and I have a big map that takes up most of the screen but I made some sprites in CHRED and I want to know how to locate a sprite. here is the code for the example

ACLS:CLEAR
LOAD"SPU0:SOLDIER",FALSE
SPSET 0,0,0,0,0,1`

LOCATE is used to designate the position for text on the console layer, not for sprites. Do you mean setting their position? That would require using SPOFS

SPOFS <control number>,<x>, <y> [, <interpolation time>]

<control number> is the index you use when using SPSET
<x> increases from left to right
<y> increases from top to bottom
<interpolation time> (optional) is the time (in frames) to move the sprite from its current position to the position you specify as <x> and <y>. Leaving this blank will immediately move the sprite to the new position

Discostew

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

Petitlife935

if i send a link to a CHRED will someone be willing to help me out ALOT and make a civil war animation??? If so it would really appriciated!

Petitlife935

Discostew

At this moment, other than some tweaks and more in-depth bug testing, all 8 Robot Masters and their attacks are implemented in my project.

Discostew

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

mystman12

Is there anyway to make SPANIM play sprites backwards? I have a head that turns to the right in four frames, and I want it to be able to turn back, but it doesn't seem like I can use negative numbers, so the only thing I can think of doing is making another set of sprites with the animation in the backwards order. (Which I don't really want to do.)

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:

Discostew

mystman12 wrote:

Is there anyway to make SPANIM play sprites backwards? I have a head that turns to the right in four frames, and I want it to be able to turn back, but it doesn't seem like I can use negative numbers, so the only thing I can think of doing is making another set of sprites with the animation in the backwards order. (Which I don't really want to do.)

Yeah, SPANIM only works in a forward-sequential manner. You'd have to make another set of sprites to accomplish the same thing, or in the case I chose, develop your own sprite animation routine. I believe PTC3 doesn't have this limitation.

Discostew

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

mystman12

Discostew wrote:

mystman12 wrote:

Is there anyway to make SPANIM play sprites backwards? I have a head that turns to the right in four frames, and I want it to be able to turn back, but it doesn't seem like I can use negative numbers, so the only thing I can think of doing is making another set of sprites with the animation in the backwards order. (Which I don't really want to do.)

Yeah, SPANIM only works in a forward-sequential manner. You'd have to make another set of sprites to accomplish the same thing, or in the case I chose, develop your own sprite animation routine. I believe PTC3 doesn't have this limitation.

Well that's kind of... Dumb, to put it bluntly. I had thought about manually moving the sprite back, but this game is just a silly thing I'm throwing together, so I'll just make more sprites. At least I can mirror them and don't have to make mirrored sprite sets too. It's just kind of annoying though because, unlike Infinite Office, which uses 16x16 or 8x8 (Can't remember right now) sprites, the sprite in question is a 64x64 sprite, so for a simple head turning animation forward and backward I'm gonna have to use up two pages of sprites.

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:

mystman12

Why oh why is sprite collision so overly complicated? In the game I'm working on I have a controllable character who can shoot, and a giant floating boss. All I want to do is make it so that when a bullet hits it, its health goes down. So, I tried making code like this:

FOR L=11 TO 31 'Those are all the possible numbers a bullet sprite could have, which allows for twenty on screen at a time.
IF SPHITSP(0,L)==TRUE THEN BOSSHEALTH = BOSSHEALTH - 1 '0 is the boss sprite number, L will obviously represent each bullet, and a side note, 1 is the player sprite number
NEXT

So that's my code, but the first time I tried running the game the boss health started plummeting. Now I just get an illegal function call, I guess because the bullet sprites don't always exist. (I have no idea why it didn't give me an error before) So what I need to know is what I'm doing right and wrong, and how to keep that command from crashing the game even with no bullet sprites. (I don't want to just place the bullets outside the screen because if the boss flies off screen I don't want it to ever accidentally hit the bullets and take damage)

Edit: Nevermind, I got it! I just used sprite groups to make it so the boss could only collide with bullets, and then used SPHITNO to SPCLR any bullets that hit it.

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:

cactuswhale

hey guys I'm pretty new here and I'm making "BASEBALL STARING HOT DOGS!!" (which is actually the first three lines) I'm done making "sprites" and screen and don't know what the heck to do

Edited on by cactuswhale

cactuswhale

cactuswhale

also IAMAPERSON I have a request for minecraft ds: the gameplay is pretty bland without music and pickaxes and other mining tools

cactuswhale

TobuKatsu

@DiscoStew Can you explain some basic platformer code? I know it was something like adding Y to mass and acceleration. I cant find any tutorials that explain it in either BASIC or without code.Its all C# or Java.

3DS FC : 4613 - 7463 - 3640
我的名字是TobuKatsu。Меня зовут ТобуКатсу. 私の名前はトブカツです。나는 이름을 케이린 입니다.
很高兴认识你。Очень приятно. よろしくお願いします。 만나서 반가워요.

Discostew

@TobuKatsu

It's not too difficult. I assume you have some understanding of the top-down concept (like the 2D Zelda games). Take that concept, but apply a downward acceleration to all valid object/entities/etc (basically, gravity). Because you are using acceleration, you also have to keep track of each object's velocity, adding the acceleration each game cycle. For instance, in MM2, most objects have a downward acceleration of 0.25 pixels per frame. If the sprite starts at 0 downward velocity, it'll be incremented by 0.25 pixels, and then the object's position is incremented by 0.25 pixels. The next frame adds acceleration again to velocity, making it 0.50. That gets applied to the position. Then another at 0.75 pixels, then 1 pixel, then 1.25 pixels, etc etc.

Because these objects will continually be accelerating downward, you check for collision with the background tiles or however you set this up. When colliding, you push the object in the opposite direction to line it up with the collision barrier (so that it won't be jittering along the boundary). So, at some point, you'd like your object to jump. Well, it's simple. Change the object's velocity to some negative number, like -3. As your code goes through the motions of applying acceleration to velocity, the object will initially move upward, but will arc until it reaches 0 velocity, to which it'll fall back down.

Not sure what else you need to know, but I hope this gets you started. Here's some example code.

CLEAR:CLS
OBJPOSY=0
OBJVEL=0
OBJACC=0.25
OBJSTOP=0

SPSET 0,0,0,0,0,0
SPHOME 0,8,16
SPOFS 0,128,OBJPOSY

@MYLOOP
VSYNC
SPOFS 0,128,OBJPOSY
IF BUTTON(2)==16 AND OBJSTOP==1 THEN OBJVEL=-9: OBJSTOP=0
IF OBJSTOP THEN GOTO @MYLOOP
OBJVEL=OBJVEL+OBJACC
OBJPOSY=OBJPOSY+OBJVEL
IF OBJPOSY>=160 THEN OBJPOS=160: OBJSTOP=1: OBJVEL=0
GOTO @MYLOOP

Edited on by Discostew

Discostew

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

Please login or sign up to reply to this topic