Liberty BASIC Community Forum
« LBPE Game Physics I and II »

Welcome Guest. Please Login or Register.
Sep 19th, 2017, 1:47pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: LBPE Game Physics I and II  (Read 1445 times)
tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1681
xx LBPE Game Physics I and II
« Thread started on: Mar 2nd, 2012, 04:24am »

2D Game Physics - Part I - Angle & Velocity
I would say, first part is great and to the point.
Code evolves logically, from simple to complex, and we have clear idea why Code:
sub setangle byref velocity.x, byref velocity.y, angle, speed 
is there at all.

2D Game Physics - Part II - Acceleration
Now, this one is mixed beast.
First, it looks like it somehow uses word "acceleration" defined wrong: is speaks about
Quote:
Four racing cars will take off from the starting line and race to the finish line. Their acceleration will increase as they move forward
,
but in the program it is speed (velocity) what increases, while acceleration remains constant.
(Just in case, Wikipedia defines Quote:
In physics, acceleration is the rate of change of velocity with time
)

Second.
Obviously it tries to reuse code from part I.
But for task being solved (four racing cars, single-dimensional race) it is definitely overkill.
It just jumps to the eye that we have SUB setangle but do not have any angles at all.
May be it's more generic this way - but until we have more broad example, it stays just that: overkill.
User IP Logged

damned Dog in the Manger
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14485
xx Re: LBPE Game Physics I and II
« Reply #1 on: Mar 2nd, 2012, 07:03am »

Anatoly, you are correct. I believe you teach this subject, do you not?

I've unlocked the page. Please make changes for Ben as necessary and both of you can modify the lesson until it is correct.
User IP Logged

benjamin805
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 419
xx Re: LBPE Game Physics I and II
« Reply #2 on: Mar 3rd, 2012, 12:16pm »

tsh73,

I posted the examples to the wiki after I learned about them. I've been trying to learn the basics of 2D game physics for some time. It can be complicated for me though. Feel free to make changes and post some new updates if you like! I should post some of the new things I've learned also. I'm currently working on some pixel perfect collision detection for 2D games and rotation. What I want to do eventually is mimic all the sprite commands in LB with API calls and then add rotation and pixel perfect collision detection as well as a function that allows the playing of more then one sound file at the same time. It's a long road, but it will be a fun journey. I'm not sure what improvement LB will have with graphics in LB5 but I'm just trying to get what I need done now so I can make game creation a little better for myself.

Ben
User IP Logged

Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14485
xx Re: LBPE Game Physics I and II
« Reply #3 on: Mar 7th, 2012, 11:38am »

The article has not been corrected. If it is not corrected soon, it will be removed. I've placed a note at the top of the page to indicate the correction needed.

User IP Logged

tsh73
Board Moderator

member is offline

Avatar

Anatoly (real name)


PM

Gender: Male
Posts: 1681
xx Re: LBPE Game Physics I and II
« Reply #4 on: Mar 7th, 2012, 2:16pm »

Alyce, please give us some time.
I will try to make amendments in next three days (08.03 - 10.03).
User IP Logged

damned Dog in the Manger
Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14485
xx Re: LBPE Game Physics I and II
« Reply #5 on: Mar 7th, 2012, 2:37pm »

on Mar 7th, 2012, 2:16pm, tsh73 wrote:
Alyce, please give us some time.
I will try to make amendments in next three days (08.03 - 10.03).


Certainly, Anatoly.

I thought Ben would want to make changes after you reported the error, but his response did not say that he would do so. If you plan to fix Ben's article for him, of course I will not delete it.

User IP Logged

benjamin805
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 419
xx Re: LBPE Game Physics I and II
« Reply #6 on: Mar 8th, 2012, 12:02am »

sorry guys I read there was an error but I guess I do not understand exactly what it is. I,ll figure it out. Just give me till Saturday cause my schedule during the week is full. embarassed thanks
User IP Logged

Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14485
xx Re: LBPE Game Physics I and II
« Reply #7 on: Mar 8th, 2012, 05:37am »

on Mar 8th, 2012, 12:02am, benjamin805 wrote:
sorry guys I read there was an error but I guess I do not understand exactly what it is. I,ll figure it out. Just give me till Saturday cause my schedule during the week is full. embarassed thanks


Your description is wrong, as Anatoly said.

Acceleration is the rate at which speed changes. Your acceleration is constant. That is, the speed changes at a constant rate.

The speed changes, so your car is accelerating. The speed changes by the same amount each time, so acceleration is constant.

Acceleration would be increasing if, for instance, you added 1 to the speed the first time, 2 the second, 4 the third, 8 the fourth, etc.

Anatoly has said that he'll modify the article so that it is stated correctly.

Thanks.
« Last Edit: Mar 8th, 2012, 08:16am by Admin » User IP Logged

benjamin805
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 419
xx Re: LBPE Game Physics I and II
« Reply #8 on: Mar 8th, 2012, 11:24pm »

Alyce,

After doing some research I found that it is possible to have a constant acceleration. What I think Anatoly is saying is that what I state in my text and what I show with my code is different. Since it is possible to have a constant rate of acceleration. Here is my data

Constant Acceleration

I have changed my example for acceleration. Please take a look and see if you agree and if I am correct in my assumption of what Anatoly has stated. If not then Anatoly is free to change the new code to show the correct method.
User IP Logged

Admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 14485
xx Re: LBPE Game Physics I and II
« Reply #9 on: Mar 9th, 2012, 05:35am »

on Mar 8th, 2012, 11:24pm, benjamin805 wrote:
Alyce,

After doing some research I found that it is possible to have a constant acceleration. What I think Anatoly is saying is that what I state in my text and what I show with my code is different. Since it is possible to have a constant rate of acceleration. Here is my data

Constant Acceleration

I have changed my example for acceleration. Please take a look and see if you agree and if I am correct in my assumption of what Anatoly has stated. If not then Anatoly is free to change the new code to show the correct method.


Ben, my reply was that your "description" was wrong and did not match the method in your code. You described increasing acceleration, but your code showed constant acceleration. The description needed to change to match the code.

A quick glance shows that your page changed drastically. I don't know who made the changes (was done anonymously), and I don't know how the code changed. I have stayed away from the page because I never took a course in physics and am therefore not adequately prepared to modify it. I have a degree in math, so I do understand the concepts, but my understanding is from the point of view of differential calculus.

Anyway... I'm delighted to see that you researched the physics involved. That's exactly what I do when I want to learn more about a subject. Even at my advanced age, I hope to never stop learning. wink

I'll leave it to Ben and Anatoly to modify the page until it is in good shape to appear on LBPE. Thanks, guys.

User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls