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 - Builderboy

Pages: 1 ... 302 303 [304] 305 306 ... 375
4546
News / Re: Axe: a new TI-BASIC-like language for the TI-83+ and 84+
« on: March 14, 2010, 04:35:43 pm »
Not yet, although there is talk about implementing it in later versions.  It will not be for a while however.

welcome to Omnimaga too! :)

4547
For turn based, on a single calculator is fine, and sometimes even preffered. 

4548
The Axe Parser Project / Re: Axe Parser
« on: March 14, 2010, 12:58:56 am »
Well, in the calculator there are no negative numbers.  Negative signs can't be programed into binary i guess you could say :P This is why its called unsigned.  But, negative numbers are very useful in many ways, so you can sign a number which makes it behave like tis negative, even though it is still represented as a positive number in the calculator.

4549
Axe / Re: Physics Lessons
« on: March 14, 2010, 12:56:00 am »
I sometimes have a hard time taking real life concepts and converting them to code effectively.
Yeah that can be a very hard challenge.  Especially when talking about really complicated things like rebound angles and the like D:

This is interesting. It might be more suitable in animations or very simple games, though, since extreme gravity calculations can take a while in TI-BASIC. Otherwise, maybe Axe Parser. Maybe it could also help other kind of programmers too. Maybe it could help for a Sonic game too :P (since the one on UTI seems to never be going anywhere...)
Yeah, one thing thats hard about implementing physics well is that it often times takes a lot of processing time.

What would you even use though for your gravity acceleration? I mean gravity in real life is 9.81... m/s2 (and 32... ft/s2 but I don't think that would work very well on the graph/home screen. But I don't know.
Well in Portal i believe i used 1/64 pxl per frame per frame, but it depends heavily on your frame-rate.  The best way to find a good acceleration is just to run some tests.  As a general rule you don't want your player moving too fast because that makes collision very difficult.

4550
Axe / Physics Lessons
« on: March 13, 2010, 10:58:33 pm »
GRAVITY:

One of the most basic Physics concepts that you might want to implement in a game is gravity.  Whether it be in a platformer, a pinball game, or something else, gravity is a common need.  So to start off, we need to ask ourselves, what it gravity?  Gravity acts on all objects on earth, and pulls the objects towards the surface, we all know that.  But its not merely as simple as decreasing the players position by 1 each frame, things don't fall that way*, as they fall they get faster and faster.  This phenomenom is known as acceleration and is the concept behind gravity and all accelerating physics.

Acceleration is measured in X Meters per second per second.  That is to say, every second, your velocity will increase by X Meters per second.  Since we live in the game world, it would be more somthing like X pixels per frame per frame.  That is to say, every frame, your velocity will increase by X pixels per frame.  Lets say your position starts at 0 and your velocity starts at -3 and you are in an empty world with 1 P/F/F
acceleration (1 pixels per frame per frame).  This chart shows your position, velocity, and acceleration for a few frames

Code: [Select]
Frame Position Velocity Acceleration
0 0 -3 1
1 -3 -2 1
2 -5 -1 1
3 -6 0 1
4 -6 1 1
5 -5 2 1
6 -3 3 1
7 0 4 1
8 4 5 1
9 9 6 1
10 15 7 1

The code for this would look something like

Code: [Select]
0->X
-3->V
1->A

While 1
Output(1,1,X)
X+V->X
V+A->V
End

Notice that even when the velocity is positive, the position can still be negative, and vica versa.  But you can see that the position starts off moving downwards, stops at -6, then starts moving upwards again.  Acceleration stays constant througout the entire simulation.  If you want to get really technical, you can go into how velocity is the derivative of position blah blah blah, but you dont need to know that in a game ;)

HOW TO USE IT:

Implementing acceleration is simple, especialy if your acceleration is constant.  You only need a single variable for your position and one for your velocity.  If you want changing acceleration you could add a variable for that too.

Also note that X velocity is INDEPENDANT of Y velocity.  That is to say, if your character has a velocity in the X direction, and has gravity affecting it, since gravity is only in the Y direction (unless your game is uber cool) the Y acceleration will only affect the Y velocity will only affect the Y position.  Try this example program for size:

Code: [Select]
ZStandard
ZInteger
AxesOff
Clrdraw
0->X
0->Z
0->A
0->B

While 1
PtOff(X,Z,2
X+A->X
Z+B->Z
PtOn(X,Z,2
getKey->K
A+(K=26)-(K=24)->A
B+(K=25)-(K=34)->B
End

Its a fun example of the power of acceleration, see if you can add gravity to it!  You might have some interesting results.

WHAT TO WATCH OUT FOR:

Acceleration is not always applied, for example when you are standing on a platform, both your velocity and your acceleration are 0.  More on this will be covered in the next section 'Collisions'

4551
TI Z80 / Re: the Tale of Lost Map
« on: March 13, 2010, 10:13:27 pm »
Hooray!  The sad fate of another lost project has been banished!

4552
TI-BASIC / Re: Lots of Questions (I'm a newb ^_^)
« on: March 13, 2010, 10:12:53 pm »
...the L1 to L6 tokens are 2 bytes...

:O Wow i never knew this!  haha you learn something new every day ;D

4553
The Axe Parser Project / Re: Axe Parser
« on: March 13, 2010, 10:11:10 pm »
I would love love love for signed numbers, because yeah, for now i have been doing things like

Code: [Select]
If(A>30000)
-(-A*5)->A
Else
A*5->A
End

to multiply numbers, which is a bit annoying.  It gets even worse for inequalities.  Instead of

Code: [Select]
A<10
You need to do things like

Code: [Select]
A<10 OR (A>65326)
Currently there are glitches in the Portal engine that would be fixed with signed numbers :)

4554
This looks really interesting!  I unfortunately cannot join as i actualy want to focus on the projects i have in production so i can finish them as fast as i can :P

4555
The Axe Parser Project / Re: Axe Parser
« on: March 13, 2010, 08:41:30 pm »
Well, there is a kind of genius to unsighned numbers in that you *can* store negative number as long as you are only doing addition and subtraction.  Lets say we wanted to store -1.  That would end up being 65535 in unsigned integers.  This is obviously not a negative number, but lets see what happens when we add 5 to it.  65535+5 = 65540.  But wait!  Integers can only go up to 65535! So the number wraps around to 4.  Did you see that?  We effectively subtracted 1 from 5, even though we added two positive numbers!  This is very very useful because it means you can do things in Axe like:

Code: [Select]
-1->A
5+A->B

And B will equal 4.  The only problem arises when you do multiplication or division, in which case the fact that negative numbers are not negative becomes apparent.

4556
Miscellaneous / Re: How did you find Omnimaga?
« on: March 13, 2010, 08:33:17 pm »
I was a frequent member at TiBD.  The creator Burr invited me over there after he saw some of my games on TiCalc.  I spent some time there until I was invited to Omnimaga by Noahbaby.  I saw how Omnimaga was more oriented towards games and I jumped at the opportunity!  A little while later I became staff, and here I am :D

4557
Axe / Re: Physics help
« on: March 13, 2010, 01:56:10 am »
* Builderboy begins work on a physics tutorial *

Since that seems to be my strong suit, writing engines :)

4558
Introduce Yourself! / Re: Howdy
« on: March 13, 2010, 01:53:10 am »
Welcome to the wonderfull work of Rick Astely Omnimaga! :D

4559
Portal X / Re: Portal X
« on: March 12, 2010, 03:55:00 pm »
Yeah i'm not surprised.  I haven't done any optimizing, and i have been putting a lot of things in subs when they are not needed to preserve readability right now.  That and i havnt been using Axe for very long :P This is one of the reasons i am thinking releasing code would be a good idea, I don't think i have anything to worry about, and we could always give it to select members only if we thought there might be a problem.

4560
Portal X / Re: Portal X
« on: March 12, 2010, 12:24:15 am »
Hmmmmm I'll consider making this an open source project as it is developed, especially since Axe is a developing language and im sure we all could learn by sharing of code.  Portal could be a learning experience for us all!

And Dj, thats the very first thing i knew i needed when i decided to make a Portal game :) I actually originally had this idea a looong while back directly after the original Portal came out.  I was going to try to make it using Omnicalc, but then i realized that there just wasn't enough speed or control to make an effective game with it.  Once i realized that i could do it with Axe, i jumped at the chance!  The code to find the position of the alternate sprite, so that your character can be in two places at one, was one of the most difficult coding challenges i have faced in a long while.  That coupled with momentum transfer left me exhausted after a whole day of coding :D  I am really happy with the way it is turning out though, already I'm flying around with Portals!

(And did anybody notice I am still using 5x5 sprites, just like in the original? ;D)

Pages: 1 ... 302 303 [304] 305 306 ... 375