forums

TNT Basic Forums > Programming Q&A
Movement of sprit or jpg
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-19-2007 19:54

Posted by:
penumbra

Find more posts by penumbra

I'm new to TNT basic I can't seem to think of a good command to making a sprit move.

07-20-2007 16:50

Posted by:
JHVipond

Location:
South Dakota

Find more posts by JHVipond

Look in your TNT Basic folder for a file called "userguide.pdf". Open that file and read the section on sprites, under "TNT Basic Help". The sprite tutorial section starts on page 472.

07-20-2007 20:37

Posted by:
penumbra

Find more posts by penumbra

pdf in my folder isn't highlighted as ,pdf and it opens up internet explorer instead of safari. I inserted this code

[code]Graphics mode 800,600
Set Framerate 30
Hide mouse
Load Images 128
Load Input 128



int x=0
while not Mouse Button


Sprite 0,x,0,0
x=x+1
Draw Frame


wend

int image=000

while not Mouse Button

' Set the position and image of the sprite
Sprite 0,0,0,image

' Increase the frame of animation displayed by the sprite
image=image+1

if image>4
image=0
endif

'Redraw the contents of the screen
Draw Frame


wend[/code]

Doing so I got a message that poped up on top of the coder section

quote:
Identifier "endif" has not been declared.


Seggestions?

07-20-2007 21:14

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

it's 'end if' with a space, not 'endif'

07-20-2007 22:45

Posted by:
penumbra

Find more posts by penumbra

quote:
it's 'end if' with a space, not 'endif'


Then how come in the animating sprites section of the sprites tutorial it saids endif without a space?

07-20-2007 23:13

Posted by:
Jacob

Location:
San Francisco, CA

Click Here to Email Jacob   Find more posts by Jacob

A typo?

07-20-2007 23:22

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Right seems like Mark made a typo - we could fix it, but Danny, has Mark given you access to the website yet?

07-21-2007 00:38

Posted by:
penumbra

Find more posts by penumbra

I still can't access the TNT Basic Help.htm and User Guide even though User Guide has a safari icon on it, but I can use the files in the TNT Basic User Guide folder.

07-21-2007 00:54

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

In TNT there is a 'help' menu, you can access the docs from there

07-21-2007 01:14

Posted by:
penumbra

Find more posts by penumbra

I still can't find the right section in TNT Basic Help to code for movement. Introduction to Sprites doesn't either. All I need to know is how to move a sprit around with keys A,S,W,D.

07-21-2007 01:22

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

window mode 640,480
load images 128

int x=320
int y=240

while true

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

sprite 0,x,y,0
draw frame

wend


-----

it uses arrows and not asdw but it shoul;d help you get started =)

07-21-2007 02:52

Posted by:
penumbra

Find more posts by penumbra

So thats how you do it. Thank you.

07-21-2007 13:46

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

@ someone

I have moderator access, not admin. I have limited control in the forums, news and directory sections (still can't edit my own posts though!), but can't upload content... Bit ironic really as my day job is a web developer!

There is a full pdf version of the user guide and help manual in the directory though (plug plug!), and there's always the 'Learn' link at the top of the page...

Danny (nod the mod)

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.