Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xeda112358

Pages: 1 ... 140 141 [142] 143 144 ... 317
2116
I have looked at it and it really does look quite nice, by the way. I see what you mean and I plan to see if I can come up with some working code. The enemies just follow you, but they cannot jump, right?

Also, I won't be back until 4 hours from now (supper, then work).

2117
Oh, I was incrementing the velocity by a number (doesn't have to be 4) to simulate a gravity-like effect. v=at, but t is measuerd in cycles, so you just add "a" every time. In this case, 4.

2118
I have finished my Tic-Tac-Toe game, and that is it. I have some non calc programmers IRL that have played it and they like it >:D But they also had suggestions. They also liked some of my humorous features >.>

2119
Okay, here is one way to do it:
Code: [Select]
X=3104       ;sets X-coordinate to 3104
Y=2080       ;Sets Y-coordinate to 2080
XE=4128      ;Sets Enemy X coordinate
YE=2080      ;Sets Enemy Y coordinate
Vy=0         ;Zero out the y velocity

// Now you are ready to do the gravity stuff!
// First we update the velocity:
Vy =Vy+4     ;Increments the Y velocity by 4

//Now we update position
YE =YE-Vy    ;Subtracts the new velocity from the position of the enemy
Y  =Y+Vy     ;Adds the new velocity to the position of you

//Now you divide the positions by 64 and use those as the coordinates :)
I am not sure how to do that on the NXT


Also, here is a very simple hitbox example that I made :)

2120
That looks a bit more complicated than needed, but did you also remember to set the enemies on half pixels?

2121
I won't be able to make sense of the code, but maybe post the code where velocity and position get updated?

2122
Okay, I will ;) I hope it works!

2123
So the half pixel is 32. Think of this: If you and the enemy are at 0 and you move down 10 and they move up 10, they are now at pixel -1 and you are still at 0. However, if you are both at 32 (the half pixel), you will both cross the pixel boundary at the same time :)

2124
Ah, okay, try starting both you and the enemies at a half pixel location. That is the way I solved it before :)

2125
Are you applying the same acceleration to the enemies? Also, do you have FP support, or just integers?

2126
Eh, I think of tilemaps as just being able to get detailed pixels and showing the detail by blowing it up in scale. When you are still checking a tilemap, you are just "pixel testing" it, but getting more than a 1 or 0 result.

2127
Exactly :) I was going to call it a layer, but I decided not to to avoid some confusion. But yes, that is how I think of it :) I think of them as layers of the screen and you are just pixel testing what is underneath.

2128
When I say buffer, I mean, in this case, that if you were to display it, you would see all the hitboxes.

2129
I am not sure about the NXT, but in Grammer, yes (and in Axe/Asm)

2130
I know you have been posting in the Grammer threads, too, so I will explain how to do it in Grammer (and probably Axe/Asm) and see if you can do it on the NXT:

First, can you draw or pixel test on other buffers? If so, for what I have been doing today. For each enemy, I have two sprites. One to be displayed and the other contains the hit as pixels on. For example, I draw this sprite to the viewing buffer:


Then on the other buffer, I draw this hitbox at the same location:


There is no need to make it like this, either. You can have a huge hitbox for enemies with some kind of aura or things like that. Anyways, then all I need to do is whenever I move, I just pixel test the location I am moving to. If there is a pixel on, it means it is in the hitbox. so you just don't move there.

The nice thing is, you can have several buffers for other things. For example, one buffer for collision, one buffer for killzones, et cetera.

Again, this all relies on the ability to pixel-test other buffers. I don't know if this helped clarify things or not :/

Pages: 1 ... 140 141 [142] 143 144 ... 317