Forums

Topic: Petit Computer

Posts 9,101 to 9,120 of 9,623

Vinyl

Can someone help me make it so that the character jumps when a is pressed? This is what I have so far, and I'm not quite sure what to put into the code to tell it to make the character jump:

'JUMP
IF BTRIG()==16 THEN GOTO @JUMP
@JUMP

2DS FC: 0533 - 5827 - 2101

3DS Friend Code: 0533-5827-2101

Discostew

@TexMurphy From what I understand, it'll only save one page at a time, and I believe it'll save the current one you have showing.

@Vinyl

Jumping mechanics will require some math and physics understanding, specifically involving gravity. This subject isn't very hard once you have the basics down. You've got gravity, which pulls down the character at a certain rate per second. This is accumulated into velocity per frame, so that the next frame will be equal to the previous frame plus the pull of gravity. Imagine gravity is about 0.25 pixels per frame, and you start out at 0 pixels for velocity. The next frame adds gravity to equal 0.25. The frame after adds another, making it 0.5. The next one makes 0.75. Etc, etc. etc. In terms of positioning, you add this velocity to the character per frame, so if the character's vertical velocity is at 0 pixels and Y position is 100, the next frame would make velocity at 0.25 and adds that to position to make 100.25. The frame after that increases velocity again so it becomes 0.50, and adding that to position would make 100.75. Etc, etc, etc. It may look like it affects positioning very slowly, but we're dealing with 60 frames per second, and after 60 seconds, velocity will have become about 15 pixels and will continue to increase.

So, now, we have the basics for how gravity affects an object, but how do we make a character jump? Well, it's real simple from this point on. When you press a button to make the character jump, change the velocity of the character to some negative number (since gravity is a positive number, and the screen from top to bottom in pixels is 0 to 191). Try an initial velocity like -3 (which based on the screen is upwards), and then fiddle with the number or a bigger or smaller jump. When faced with touching the ground, hitting the ceiling, etc, change the velocity to 0 to reset it.

Now, about making the initial jump, you may only want to make the character jump when touching the ground (unless you want the character to jump while in the air for a reason, like a double-jump). Assume only jumping from the ground. This means you need some indicator with the character on whether you are touching the ground. What I did with my project is that each frame, I checked the space below the character. If it is empty, then the character is not touching the ground. Else, he is, so I then made it that if he is touching the ground, then the button to make him jump would be allowed.

Discostew

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

TexMurphy

Thanks @Discostew Unfortunately, I messed up and deleted Johnny Cage and Kano. But I still have Sub-zero and Sonya sprites.

TexMurphy

Hairmanban19

@Traulight sorry, but I'm already working on a project. It's an First Person RPG focused on exploration with grid-based movement (I.e Wizard Series, Etrian Odyssey), and its setting is similar to Daggerfall's. So no, I can't really do anything like that right now, sorry.

...

3DS Friend Code: 3136-7615-5907

Gimmemorecoinz

A post about collision in the zelda engine.. any opinions/comments are welcome.

Also a collision extension needs to be coded for things like enemy arrows, fireballs, and such.
And link's sword.
I could simplify it and assume if link is swinging and his sprite hits an object then the object dies if its within a pixel range in front of whatever direction he's facing.
But you see how this quickly consumes conditional statements.
If link_facing==2 then if link_swinging==true then if swing_frame<=4 then if current_enemy_x<link_x+16 and current_enemy_x>linkx and current_enemy_Y<link_y+16 and current_enemy_y+16>link_y then hit_en==true: en_hit_num=current_enemy

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

damolii

Gimmemorecoinz wrote:

A post about collision in the zelda engine.. any opinions/comments are welcome.

Also a collision extension needs to be coded for things like enemy arrows, fireballs, and such.
And link's sword.
I could simplify it and assume if link is swinging and his sprite hits an object then the object dies if its within a pixel range in front of whatever direction he's facing.
But you see how this quickly consumes conditional statements.
If link_facing==2 then if link_swinging==true then if swing_frame<=4 then if current_enemy_x<link_x+16 and current_enemy_x>linkx and current_enemy_Y<link_y+16 and current_enemy_y+16>link_y then hit_en==true: en_hit_num=current_enemy

Can you.... do that? O.o

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

Discostew

Gimmemorecoinz wrote:

A post about collision in the zelda engine.. any opinions/comments are welcome.

Also a collision extension needs to be coded for things like enemy arrows, fireballs, and such.
And link's sword.
I could simplify it and assume if link is swinging and his sprite hits an object then the object dies if its within a pixel range in front of whatever direction he's facing.
But you see how this quickly consumes conditional statements.
If link_facing==2 then if link_swinging==true then if swing_frame<=4 then if current_enemy_x<link_x+16 and current_enemy_x>linkx and current_enemy_Y<link_y+16 and current_enemy_y+16>link_y then hit_en==true: en_hit_num=current_enemy

Why not set the sword sprite with a collision box via SPCOL, enemies also with a collision box, have them both contain a group bit that is the same that is not shared by Link, and then during the frames of the sword swinging, check via SPHIT to see if the sword sprite is colliding with an enemy sprite?

Discostew

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

BonChoi

Okay,. after many days of hard work, here it is! PTC-DOS 1.6!

BonChoi wrote:

Okay after long days of working, it is out! PTC-DOS v1.6!

...I'm sorry.

Programmer for Minecraft DS!

Press B!

Gimmemorecoinz

Hey everyone, if you like cool games, here's my new little demo. ROBOT BATTLE.
It's a bit minimilistic. But I tried hard with presentation.
Here.. it is... http://imgur.com/WiBMAHE
I hope people are cool with it. >.<
Dont die!

Got a project? PM ME on here!
Youtube: lostkitty64x
Want help with coding? PM ME! PM ME PM ME!! XD
FC: WIll post later.
Systems I own: ds lite, 3DS, PC/gaming, steam platform. I play alot of games. Just ask ! Minecraft anyone? :D

SmokedSausage

damolii wrote:

I think that the lure and awe of a programming tool on portable devices such as the DSi and 3DS is starting to wear off sadly :/

On a lighter note though, does anyone have any idea on text effects?? For instance, I have this method of making text appear next to one another, but it's rather tiresome:
?"H":WAIT 5: CLS: ?"HE":WAIT 5:CLS:?"HEL":WAIT 5:CLS:?"HELL":WAIT 5:CLS:?"HELLO"
As you can see it's really long... and "bulky", as it erases all the text on screen. Anyways, I thought of saving letters, and storing them as numbers or characters, then finding a way to load these characters whenever I please. However, the method I thought of applying those characters seemed rather counterproductive, as it required going through the same process mentioned above, just with characters. Does anyone have ideas on how to make this process more efficient, especially the part about erasing all the text on screen(it bothers me)? It's pretty exciting thinking about different ways. It could change the PTC text world forever!!! ^o^

FINALLY SOMEONE BESIDES ME HAS THE FREAKING STANDALONE!? Omg, we should play sometime.

Hi, I'm SmokedSausage and i like meemoos :^)

Twitter:

InsertPi

I have begun work on RPG Maker 2014 PTC! RPG Maker PC brought us games like Ib and The Witch's House. This PTC version will allow you to make games like that, just not as complicated. The game maker will come as two programs. One for the editor, and one for the engine. You edit your game in the editor. When you save, it uses 4 GRPs for the data and any provided custom spritesheets, all packaged with the engine. This whole process will be automatic, so upon launching your program (name of your choice—also automatic) it will load up just like a normal game! The final product is packaged so you don't have random files floating around and for ease when publishing your game. You can make a full-out game without ever going into the PTC editor! The GRPs will hold data as follows:

1 for map layers one and two
1 for all strings of text in the program (up to 382 128-character long strings
2 for the event layer (stuff like going from room to room, doors, inspect items, triggers, cutscenes, etc.)

From the people I've asked, it's a good idea. What are you guys' opinions?

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:

LeviCelJir

Sounds kewl Hi. I hope you finish it Hi.

Hi I'm Levi and I like Bloopys :^)

Mariominer

I discovered something while programming with BG tiles. So, I loaded a BGU0 file, and display looked fabulous on the top screen, but on the bottom looked terrible. It turns out that when you load a BGU resource tile to display on the top and bottom screen, you need to load it 2 times-changing the BGPAGE. So does this mean potential? Could you have 2 different BGU files of the same number loaded at a time and do something funky with that? I also discovered something else. It turns out in DATA statements, the quotes around strings do not need to exist as long as there's no spaces. This can be useful in some cases, like in making a hexadecimal string in data-
DATA FFFFFF
READ WHITE$
COLSET "GRP", 1,WHITE$
So it can be useful. Feel free to use quotes, and don't forget to do quotes with strings with spaces, commas, or colons. Quotes are still probably the way to go.

Edited on by Mariominer

Like a boss? Please, I AM a boss. You're welcome

3DS Friend Code: 1543-5315-3818 | Nintendo Network ID: Storybookten9

damolii

SmokedSausage wrote:

FINALLY SOMEONE BESIDES ME HAS THE FREAKING STANDALONE!? Omg, we should play sometime.

??? The..standalone...??

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

InsertPi

Petit Computer yet again defied my expectations with memory. For RPG Maker 2014 PTC, I need a map array for 380+ rooms, each room being 15x9. So look at how huge these arrays are that I DIMmed with no problems!

DIM MAP(5760,18) '15*384 rooms, 9*2 layers
DIM EVENT$(5760,9) '15*374 rooms, 9 layers, string to hold "event commands"

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:

LeviCelJir

IAmAPersson wrote:

Petit Computer yet again defied my expectations with memory. For RPG Maker 2014 PTC, I need a map array for 380+ rooms, each room being 15x9. So look at how huge these arrays are that I DIMmed with no problems!

DIM MAP(5760,18) '15*384 rooms, 9*2 layers
DIM EVENT$(5760,9) '15*374 rooms, 9 layers, string to hold "event commands"

Whoa that's amazing Hi

Edited on by LeviCelJir

Hi I'm Levi and I like Bloopys :^)

damolii

@IAmAPersson I have been messing with your text scrolled TRYING to get it to work with DATA.. and I haven't solved a things Self Esteem-9001!! Could you release the QR code with the DATA already there? Thx '~'

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

InsertPi

@damolii sure.
Also, I have to remember that I DIMmed a 30,000 slot array for the memory for my Brainf*ck Interpreter, plus a 100,000 for code storage. Minecraft DS has 4 128x128 arrays. They can be very large.

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:

Top

Please login or sign up to reply to this topic