forums

TNT Basic Forums > Programming Q&A
A little help will go a long way...
< Last Thread     Next Thread >
Author
Thread        Post A Reply

04-05-2003 16:53

Posted by:
mtnbording

Click Here to Email mtnbording   Find more posts by mtnbording

I'm still very confused on how to make a sprite load from the image bank, move in a direction (while pressing a button), move in a certain speed, and where the sprite is loaded on the screen.

To make my self more clear I was wondering if one of you could write the code that could do this and then post it so I can understand it: Load an image from the image bank, turn it into a sprite, place the sprite somewhere on the screen, and make it move in a certain direction while pressing a button.

I know this sounds like a lot, but it will really help me out.

thanks,
Matt

PS. I wrote this in the morning so it might sound a little wierd!

04-05-2003 18:20

Posted by:
No Frills

Click Here to Email No Frills   Find more posts by No Frills

Problem sorted

I believe the guy who programmed Penguin Power for the iDevgames competition (sorry, I forgot your name.... my bad....) has posted a nice sprite demo already.

More to do with collision detection - but it does exactly the type of thing you are looking for.

04-06-2003 03:49

Posted by:
mtnbording

Click Here to Email mtnbording   Find more posts by mtnbording

cool

nice, where can I find this tutorial?

thanks,
Matt

04-06-2003 03:59

Posted by:
jamie

Click Here to Email jamie   Find more posts by jamie

Hi, the tutorial you are looking for is here:

http://www.clay-communications.com/jamie/files/sprite_tile_collision_tutorial.sit

hope it helps out!

04-12-2003 19:13

Posted by:
mtnbording

Click Here to Email mtnbording   Find more posts by mtnbording

frustrated

I can't seem to get anything from that tutorial. (Sure a few things but not enough) Please tell me what I am doing wrong:

Global int playing=true,currentlevel=128,lives=1,quit=false,done=-1 'various general variables

Global int player=128,playerx,playery,playerdownl,playerdownc,playerdownr,playerid=0,playerdir=0,playerdrop=true,playerfallspeed=4 'player specific variables

Graphics mode 640,480

load images player
load map 128
sprite 0,50,50,0

if pressed(126)
playerid=1
playerdir=1
end if
draw frame
wend

Ok, lets start way at the bottom with wend. No one in any tutorials has mentioned what this means. I've sortof figured it out though.I think it means to repeat the drawframe command. Am I right? now lets go to player ID. What does this mean? I'm pretty sure that it's important but I cant find anything on it. (i just threw that into the code to see what happens)

Very Frustarted,
Matt

PS, Is there any really really good tutorials out there that can show me the basics of how to use TNT? I'm saying this because I'm v ery dissapointed with how there are not very good showmehows on the site.

04-12-2003 23:23

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

You maybe need to learn the basics of programming:

(wend is "while" end, the end of a "while" loop you called before)

Check the tutorial on programming in TNT help.

The main struct of a moving object coul be:

repeat
draw frame

sprite 0,x,y,0

if up then y=y-1
if down then y=y+1
if left then x=x-1
if right then x=x+1

until space


"repeat" says that all the code after it is repeated undefinetely "until" you press space

it is equivalent to

while not space

draw frame

sprite 0,x,y,0

if up then y=y-1
if down then y=y+1
if left then x=x-1
if right then x=x+1

wend

04-13-2003 05:14

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

I suggest you read the help files from the help menu; the "TNT Basic Help" will give you the syntax and what each command does, and the "TNT Basic User Guide" will give you a quick tutorial of programming. You can also find tutorials in "TNT Basic Help." Both of these should be in the "Help" menu in Hieroglyph.

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.