Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.
This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's General Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Open Topic & United-TI Talk => General Open Topic
Author Message
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 20 Sep 2010 11:22:38 pm    Post subject:

Okay, so as many of you may know, I am a long time Ti-basic programmer. I know how to do just about everything, except graphics and enemy ai.

For Graphics: I can make hard-coded or pre-loaded screens, but not on the spot changes.

For Ai: I have no idea how to program an enemy loop into your own action loop. E.G. an enemy that moves back and forth.
Furthermore, i would greatly enjoy it if someone could help me. I wanna make a TD game, but can't because I don;t know where to begin to code multiple towers damaging, not to mention upgrades.

And I put this in open topic because I have another question. Where do you see calculator programming going from here? Ti-Basic is popular amongst beginners for it's ease of use. do you see a greater expansion of its abilities?
Back to top
AHBAD_ALVIN


Advanced Newbie


Joined: 18 Sep 2010
Posts: 74

Posted: 21 Sep 2010 05:59:41 pm    Post subject:

Personally, I think Ti-BASIC is being opposed by many better third party languages. Last year, BBCbasic was released, which topped BASIC indefinately. Then Axe came, which blew away both of them. Personally, I'm making my own language right now; but until I can get some experienced z80 coders to help, I'm just continuing my Strategy game, Rule and Conquer (IN 4 COLOR GRAYSCALE!!! COOLIO!!!)

But sure, I could teach and help you write some good AI, it happens to be one of my favorite things to make in basic. I'd go into a long list of projects I once made, but I almost got banned from 3 different sites for "continuous ranting about personal skills" :P

But to tell you really short of what I can help you with, I once wrote a script that when you move around the screen, these towers start shooting you if you were close enough...
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 23 Sep 2010 06:40:46 pm    Post subject:

ASHBAD_ALVIN wrote:

Personally, I think Ti-BASIC is being opposed by many better third party languages. Last year, BBCbasic was released, which topped BASIC indefinately. Then Axe came, which blew away both of them. Personally, I'm making my own language right now; but until I can get some experienced z80 coders to help, I'm just continuing my Strategy game, Rule and Conquer (IN 4 COLOR GRAYSCALE!!! COOLIO!!!)

But sure, I could teach and help you write some good AI, it happens to be one of my favorite things to make in basic. I'd go into a long list of projects I once made, but I almost got banned from 3 different sites for "continuous ranting about personal skills" :P

But to tell you really short of what I can help you with, I once wrote a script that when you move around the screen, these towers start shooting you if you were close enough...


That is exactly what i need. i am interested in making a Tower defense game. Too minimize on the coding, only on enemy would appear on screen at a time, but they would get progressively harder, and quicker, to help balance it. I just need help writing the code so that the game can keep track of multiple towers and then have them fire when a monster is within range. And possibly, for a monster to go around them, but that part I can do.

Basically, I need help on how to make the tower fire and when.

Once I get the theory/concept, I might be able to do it on my own, but not yet.
Back to top
cjgone
Aw3s0m3


Active Member


Joined: 24 May 2006
Posts: 693

Posted: 23 Sep 2010 10:12:59 pm    Post subject:

Quote:
I have no idea how to program an enemy loop into your own action loop. E.G. an enemy that moves back and forth.


Very basically, have a direction for the object, such as a variable that stores e.g 1 or -1). When the object e.g hits a wall you reverse the direction


Code:

1->V // goes right initially, this is the velocity, aka, V
1->X // inital xcor
//some initial y cor
Output(Y,X, "W") //enemy
while 1
//more code
//more code

if X = 10 or X = 1   // boundaries the object will reach
then
-V->V  // if a boundary is reached, change the direction of its velocity
end
output(Y,X, " ")
X + V -> X  // add the velocity to the xposition.
Output(Y,X, "W") // some random object


Only for one object, but basic idea.


Quote:
. I wanna make a TD game, but can't because I don;t know where to begin to code multiple towers damaging,


Needs arrays for mutiple objects if there aren't small fixed amounts.


Last edited by Guest on 23 Sep 2010 10:18:02 pm; edited 1 time in total
Back to top
Bhaliar


Member


Joined: 16 Nov 2009
Posts: 221

Posted: 24 Sep 2010 03:02:13 pm    Post subject:

cjgone wrote:

Quote:
I have no idea how to program an enemy loop into your own action loop. E.G. an enemy that moves back and forth.


Very basically, have a direction for the object, such as a variable that stores e.g 1 or -1). When the object e.g hits a wall you reverse the direction


Code:

1->V // goes right initially, this is the velocity, aka, V
1->X // inital xcor
//some initial y cor
Output(Y,X, "W") //enemy
while 1
//more code
//more code

if X = 10 or X = 1   // boundaries the object will reach
then
-V->V  // if a boundary is reached, change the direction of its velocity
end
output(Y,X, " ")
X + V -> X  // add the velocity to the xposition.
Output(Y,X, "W") // some random object


Only for one object, but basic idea.


Quote:
. I wanna make a TD game, but can't because I don;t know where to begin to code multiple towers damaging,


Needs arrays for mutiple objects if there aren't small fixed amounts.



Hmm, I see what you mean. Maybe i will limit it? I dunno... And thanks for the other code. I see what i was doing wrong.
Back to top
AHBAD_ALVIN


Advanced Newbie


Joined: 18 Sep 2010
Posts: 74

Posted: 25 Sep 2010 10:56:40 am    Post subject:


Code:

3 -> dim([sub]L[/sub]OBJEC  ;setup the velocity and health list
1 -> [sub]L[/sub]OBJEC(1)  ;the x velocity
1 -> [sub]L[/sub]OBJEC(2)  ;the y velocity
5 -> [sub]L[/sub]OBJEC(3)  ;the health of the object
Repeat [sub]L[/sub]OBJEC(3)=0
;all that other code
End


using lists will keep variables free for other things more important. If only BASIC had OOP...

[spoiler]...but my new language will! lol Very Happy OOP will make the management of the towers SO much more organized and easy tokeep track of...[/spoiler]


Last edited by Guest on 25 Sep 2010 01:47:24 pm; edited 1 time in total
Back to top
AHBAD_ALVIN


Advanced Newbie


Joined: 18 Sep 2010
Posts: 74

Posted: 25 Sep 2010 01:58:16 pm    Post subject:

Also, when to fire is actually pretty easy. lets pretend that you only have one tower and one object to be shot at. Here's what you could do (and also, the = means ->, I'm just too lazy to type it out)

Code:

X = 3:"object X
Y = 3:"object Y
I = 3:"tower X
J = 7:"tower Y
H = 3
Repeat getkey = 45 OR H=0
"the movement of object code goes here
If X=I-1 AND Y=J-1:"basically, if the object is within 1 unit of the tower
H-1=H
End


This will make it if the object moves within 1 unit of the tower, it will lose 1 health AKA has been shot at once.

You might be wondering how to make an object follow a path. To do this, you would need to have a list of lets say... 20 elements. So you would have a counter and when the enemy moves, it checks the list(counter's value) to see where to go; so basically, if the list element for the next move is 1, then the x velocity is one and the y velocity is 0; if it is two, then the x velocity is 0 and the y velocity is 1 (so it would follow a listed "path" -- this is the most memory efficient way to do it rather than a matrix (though it will be only a tiny bit slower!)
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 

Advertisement