forums

TNT Basic Forums > Programming Q&A
Question from the Newbie
< Last Thread     Next Thread >
Author
Thread        Post A Reply

03-02-2004 16:18

Posted by:
Mispeled

Location:
Cincinati, Ohio

Click Here to Email Mispeled   Find more posts by Mispeled

Are save games possible to program, other than the classic Lemmings "Enter the password to access level" thing? Thanks. :-)

03-02-2004 17:56

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

yes. look in the documentation under 'files'.

04-13-2004 07:56

Posted by:
Giovanni Hernandez

Location:
Centennial CO

Click Here to Email Giovanni Hernandez   Find more posts by Giovanni Hernandez

Books for beginers

Hi guys I'am new with TNT. Have never program games ether
I have been trying to understand its way of coding but
I only understand like 40% of it.....Well I understand the
coding in a way but i dont know when i need to use then like at the
begining,, in the midle or at the end.... I have follow the
examples but it looks like there is so many ways to code.
None of the examples look the same. Can any body can recomend
me a book step by step to read, for beginers like me.... cuz i am going crazy lol....... Thank you all.......

04-13-2004 08:51

Posted by:
puffin

Click Here to Email puffin   Find more posts by puffin

there aren't any books on TNT BASIC, but you can find a lot of books on QBASIC. try "QBASIC by example", i used it for a class and it was great. once you learn a BASIC you shouldn't have much trouble with others.

a piece of advice, don't put off learning math. trig is very useful.

as for all of the examples being different, that's just style. everyone has there own little style. at least TNT BASIC doesn't use braces :)

04-13-2004 19:08

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

yeah, everybody has his own stile in TNT... this is because nobody really taught us programming and we just hack through the code in the way we like best ;-) this is quite cool actually though I'm pretty sure the code of 90% of people here is quite nuts (mine included):

the TNT guys are responsible for a horde of terrible coders in the mac game industry ;-p

Back to the topic:

Can you make a sprite move up, down, left and right? this is the first step. Then add something with wich you must avoid collisions, add something you must catch, add gravity, ability to jump, jumpin enemies or anything and your game's done ;-)

04-14-2004 04:24

Posted by:
Giovanni Hernandez

Location:
Centennial CO

Click Here to Email Giovanni Hernandez   Find more posts by Giovanni Hernandez

Thanks Puff and Don. Matteo

Thanks Puff and Don. Matteo for your answers....
Yea to bad i wasnt tought any programming at school
computers weren't a big thing back in the 80's lol
and yes Don.Matteo 90% of this programers seens like nuts lol
well I think it should be an order in coding.... specialy when
you are giving examples,you know,,,,, It makes new users
lost and confuse.and yes I know how to move my sprite and canvas,make a map, add music... but I cant make my sprite
bump into wall or walk in top of things.......
But I am almost there =)... puff yes you are right in the
math thing... my Girl friend is a Math geek who goes to
college and still dont get some of TNT coding.....lol that
makes me feel better since I didnt graduated from the Institude... I dont think TNT isnt that hard is just
dont have and order of coding or 1 way to code.

Once again thank you guys for your tips, it means alot to me.

From: Don. Giovanni

04-14-2004 13:22

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

You know reading code is I think harder than writing it

you could try to do this for homework: have your character (as in Nintendo's Mario) that stands on the floor, and can move left and right and jump. then have some enemies coming to you from the right of the screen: as in Mario Bros, you must jump on them to destroy them, and if you don't manage and get hit you loose.

So these are the things you must do:



1)sprite mario at coordinates X,Y
2) Calculate the changes in X,Y:

X changes when you move left and right (i.e. if right then X=X+3)

Y changes when you are jumping according to gravity... now here we have a bit of a problem since with gravity you do not have a constant speed but rather a costant acceleration:

so you need to keep track of the Yspeed:

if Y>=480 (that is, mario is on the floor)
Yspeed=0
else
Yspeed= yspeed+1 (constant gravity)
end if

then you must add this speed to the actual Y

Y=Y+Yspeed

if space then Yspeed= Yspeed-10 (this makes him jump if you press space)

Finally tou just have to move enemies and figure out how to decide weeather you have hit them or they have hit you.

Well, if you can do this, you have basically programmed Mario Bros!

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.