Forums

Topic: Petit Computer

Posts 9,081 to 9,100 of 9,620

Discostew

Aw jeez. I was all ready to begin adding this, but then I realized a snag. My sprite handler also has the ability to freeze a sprite in the middle of the animation (meant for using Flashman's weapon), and then have the animation resume later on. That's something I can't do with SPANIM. I can't even swap between the two in the middle of the animations because then I would have to keep track of the animation frame/delay, nullifying any performance gain I would have had, and that's only if my program never dropped below 60fps since using SPANIM isn't restricted to code execution of VSYNC.....

Edited on by Discostew

Discostew

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

Discostew

Ok, forget what I posted, because I think I found a way around it. Since animation via SPANIM relies on the screen refresh rate rather than the program loop, it means I can use MAINCNTx to figure out which frame and frame increment the moment my freeze operation gets applied, force it to stop animating by setting the character index with SPCHR and setting 1 frame for SPANIM, then when I resume, I can manually animate the sprite until it loops around, to which then I'll give back control to SPANIM.

Discostew

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

InsertPi

damolii wrote:

@IAmAPersson I'm still having trouble using DATA for your text scrolled. Any explanation would be appreciated l. , .l

RESTORE@STRINGS
DIM TEXTS$(3)
FOR I=0TO 2
READ TEXTS$(I)
NEXT
FOR I=0TO 2
'We assume that the engine itself is under a subroutine called @TEXTANIM
TEXT$=TEXTS$(I)
GOSUB@TEXTANIM
NEXT
END
@STRINGS
DATA"Your string here","Another string","Yet another 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.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

Gimmemorecoinz

Anyways uhh I have an issue.

This is rather irritating. It may take an expert!
http://imgur.com/z2HWi5w This is the zeldamapper I'm working on.

replace the prg zeldampr with this qr: http://imgur.com/3AqXoKk

now the issue is when running from gallery...
BGU0 doesn't load LA00_PNG properly.
It draws the tiles at the top.
Then when I begin placing the tiles on the touch screen.. petit computer does something REALLY MESSED UP
it decides that it's going to use it's own BUILT IN tileset instead of BGU0
What the heck is going on here? Can somone help???

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

Gimmemorecoinz

^ and this is why I hate petit computer sometimes. LOL.

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

Gimmemorecoinz

An update to the issue I posted above. I did some enraged tinkering.

Set BGPAGE to 0
Loading Tiles to BGU0

Draw some BG tiles to top screen

SET BGPAGE to 1
Try to use UPATEFULL from discostew's engine to update.
Tiles are petit computer's default tiles on bottom screen.
Running it again fixes it (I'm assuming because the second time BGPAGE is set to 1 by default)
Going to try setting BGPAGE to 1 first..... I hope this doesn't break... Urgh.

EDIT: Okay so... if anyone cares in the future. DONT load your own BG TILES. and then SET BGPAGE to a page that it wasn't set to you loaded them.
It messes up and somehow un loads the tiles you loaded. Yet it's fine if you don't switch BGPAGES again. I hope this helps someone I wasted hours with gcls and clear and acls and GPRIO trying to fix it... out of other issues... kay thanks. ANd I'm sorry that in future code with BGPAGE I will be forced to basically load multiple bgs all at once for both BGPAGES. Hope you don't mind the wait times for these! (They seem fast? )

Edited on by Gimmemorecoinz

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

brizobst

Question about CLEAR and GOSUB

I have a program that has gotten a little complicated, I made a bad habit of having goto commands inside go sub routines, and as you can imagine, after the program has been running awhile, I get out of memory errors (probably because the program has been looking for a RETURN command for too long).

I thought I could get around this by forcing the player to save between levels, then sending the program back to the first line and using CLEAR.

I noticed however, that even if you use CLEAR, the program remembers it is looking for a RETURN command, does anyone know a way around this? (aside from going through all my goto and GOSUB routines and cleaning things up, which I realise may be the only solution).

brizobst

Discostew

@brizobst Every GOSUB must have a RETURN. PTC can only hold so many pointers in the stack before it overflows (out of memory), and each RETURN reduces that stack by one. CLEAR only messes with variables and arrays. The pointer stack for GOSUB/RETURN gets cleaned out each time the program starts (not when it ends because doing a break and then using CONT allows it to keep going under some circumstances, retaining what it had in memory).

Discostew

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

damolii

@IAmAPersson "@TEXTANIM" starts from RESTORE @STRINGS, right?

Also, would I still need MID$ for the effect? I saw that MID$ picks how much of the text to display, and the speed at which to display. Lastly, for some reason I'm getting duplicate definitions for DIM TEXTS$(3). I use CLEAR when the program starts, but for some reason, it doesn't have an effect. It's only when I put it in the subroutine and it works, though obviously I don't want to put it there as it would keep clearing the amounts.

Edited on by damolii

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

Gimmemorecoinz

So I'm not advertising this but I'm advertising this. I fixed alot of issues with my editor I was up all night lastnight.
I worked really hard on this so far and I just wanna give back to the community.
This editor can't save yet but in the future it will be useful for making very large maps that are 255 by 255, or larger.
Something that SCRED can not do.
http://imgur.com/hlb1mOM
The instructions are in the program if you get lost private message me or post questions about it here. I don't know how fast the forum will move but I'll probably skim for responses to my post later.
I'd like some feedback to if you try it if it isn't asking too much, I need to bug test it so yeah. Just give it a try if you like map editors.

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 The art looks great. I don't really know how to use map editors well, but when I wanted to switch to a different part of the tileset, (e.x switching from a part of the tree to the green grass), the part of the map I already selected and put where I wanted on grid moved too. Is that supposed to happen?

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

Traulight

@Hairmanban19 have you ever thought about making some kinda D&D style program with a dice rolling system and stuff like that?

Traulight

TexMurphy

CHRED question. If I am creating custom sprites in this program, when I save am I only saving the sprites I see on page 0 or am I saving all other pages? I am making Mortal Kombat characters 4x4 which puts one character set per row for two character sets per page. Can I use the other page numbers and get more characters per file? Or do they save like SPU0, SPU1, ... SPU7?
Untitled

Edited on by TexMurphy

TexMurphy

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

Please login or sign up to reply to this topic