Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - epic7

Pages: 1 ... 110 111 [112] 113 114 ... 161
1666
Other Calculators / Re: To Do Manager
« on: November 30, 2011, 09:13:29 pm »
2 spelling errors >:D
Cool program, anyway.

1667
News / Re: Builderboy's Sonic Physics program gets Revamped
« on: November 30, 2011, 09:05:49 pm »
WOW this is awesome!!! it would be really cool if someone took this and made actual sonic on calc
This is not sonic?

1668
TI-Nspire / Re: Bomberman
« on: November 30, 2011, 08:44:56 pm »
Is there a speed gain for using less color?

1669
Axe / Re: help with bullets!
« on: November 30, 2011, 08:31:17 pm »
My code is longer because it controls a lot of  bullets and has collision detects.

But I bet someone could still omptimize it :P

1670
Axe / Re: help with bullets!
« on: November 30, 2011, 08:24:36 pm »
Are a and d both for different bullets?

1671
TI-Nspire / Re: Bomberman
« on: November 30, 2011, 07:40:40 pm »
Lua slow?

1672
TI-Nspire / Re: Bomberman
« on: November 30, 2011, 07:34:35 pm »
I think I remember you mentioning this in irc.

Also, I really thought you made call of duty :P
* epic7 lost

1673
TI Z80 / Re: Fullrene
« on: November 30, 2011, 07:24:10 pm »
I saw just use
Fcdf()
In a later post, but since fcdf(1) was in the first post, I went with that

1674
Axe / Re: help with bullets!
« on: November 30, 2011, 07:21:05 pm »


I originally typed this to help out hellninjas, but I decided to give it to you since I already took the time to type it :P

This is actually longer than the one I gave him.


My setup is when a bullet's tasks are done, the bullet check changes. For example,


When the bullet check = 0
That means a new bullet is ready to be shot


When the bullet check = 1
That means the bullet's coordinates and left/right need to be set.


When the bullet check = 2
That means to move the bullet.

Now, to start the real programming.

Pick a variable for your for loops. I used V.
Pick L1, or L2, or L3, etc. I used L5.

Im taking this mostly from my game. These bullets will be shooting left and right, not up and down, so if that's what your game needs, you will have to tweak this code.

Outside the main loop,


:.The sprite.
:[FCFC000000000000]-> Pic2
:For(V,0,5)
:0->{V*4+L5}
:End

In my for loop, I put 5 there to say what the max possible bullets on the screen would be.
{V*4+L5} will be my bullet check. That sets the bullet check to zero.
As you can see by what I previously wrote, when the bullet check is zero, it means the bullet is ready to be fired.


:25->S->T

Actually, this also checks if a bullet to be fired. If only {V*4+L5} the only check, they would all fire at once. S and T will be what spaces the bullets. T will gain 1 every time the loop finishes and when it reaches S, which is set to 25, a bullet will be ready to be fired.

So together {V*4+L5} and S/T are what checks if a bullet can be fired. If you'd like to make it shoot faster, lower S and T. But where it says
For(V,0,5)
If you speed the bullets up you'll have to increase the 5 so that L5 wont run out of bullets!


:Repeat getkey(15)
:If getKey(54)
:For(V,0,5)
:If T=S
:.Checks if T=S so that the bullets are spaced out
:!If {V*4+L5}
:.If the bullet check is 0...


Above, I have the calculator find a bullet that is ready to be fired.

Now that we found a bullet, you have to change the bullet check to 1 and reset the spacer.

:.Change bullet check
:1->{V*4+L5}
:.Turns T back to 0 and it will have to go back up to 25 (S) to fire again
:0->T
:.Exits this loop now since we already have our bullet
:Goto X
:End
:End
:End
:End
:Lbl X


As I said before, when the bullet check is 1 it means the bullet's coordinates and left/right need to be set.


:For(V,0,5)
:If {V*4+L5}=1
:.If bullet check = 1
:.Set the coordnates of the player to the bullet
:X->{V*4+L5+1}
:Y->{V*4+L5+2}
:.Put it on the screen
:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2
:.Turn on the bullet check to 2 now.
:2->{V*4+L5}
:.You should have a variable that tells if the character is left or right. Save that to the bullet like as shown here
:R->{V*4+L5+3}
:End
:End



If you dont have a variable that says if the character is facing left or right, add one!
Also where I have said
X->{V*4+L5+1}
Y->{V*4+L5+2}
Tweak that to exactly where you want the bullet to start, or it'll just start at the top left of your player.

Here, this will move the bullet, which is when the bullet check equals 2.

:For(V,0,5)
:If {V*4+L5}=2
:.Checks if the bullet check is 2...
:If {V*4+L5+3}
:.If facing right..
:{V*4+L5+1}+2->{V*4+L5+1}
:Else
:.If its not,
:{V*4+L5+1}-2->{V*4+L5+1}
:End
:.Show the bullet
:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2)
:End
:End


Here, I have what checks if the bullet is off the screen and then resets the bullet.


:For(V,0,5)
:If {V*4+L5+1}>90
:.If the bullet is off the screen (Works for both left and right side)
:.Set the bullet checks back to zero and put the coordnates off the screen to not interfere
:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}
:.Now the bullet check is back to zero to start the cycle over again.
:Return
:End
:End


Don't forget to make T change so that bullet spacing will work!


:.Make T move up to S for the bullet spacing
:If T < S
:T++
:End


And that's it for bullet moving. Here's some collisions now!
In this example, A and B are the enemy's X and Y coordinates.


:For(V,0,5)
:.Collision detect
:If abs({V*4+L5+1}-A)<6
:If abs({V*4+L5+2}-B)<6
:. I'll use C for the enemy's health
:C--
:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}
:. The same thing as before, to reset the bullet
:End
:End
:End


It's the same idea for multiple enemies
Here, P and L1 are for the enemies and
{P*2+L1) = X coordinate
{P*2+L1+1) = Y coordinate


:For(V,0,5)
:For(P,0,3)
:. Has to check a For( for the enemies and the bullets
:. Collision detect
If abs({V*4+L5+1}-{P*2+L1})<6
If abs({V*4+L5+2}-{P*2+L1+1})<6
:. I'll use P+L2 as the enemy's health
:{P+L2}--
:. Remove one from the health
:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}
:. Bullet reset
End
End
End
End
End


OK! Now here's the whole code.
The only thing it's missing is the player.
Add the player and you'll be good to go!
Dont forget to tweak
X->{V*4+L5+1}
Y->{V*4+L5+2}


:[FCFC000000000000]->Pic2
:For(V,0,5)
:0->{V*4+L5}
:End
:25->S->T
:Repeat getkey(15)
:ClrDraw
:If getKey(54)
:For(V,0,5)
:If T=S
:!If {V*4+L5}
:1->{V*4+L5}
:0->T
:Goto X
:End
:End
:End
:End
:Lbl X
:For(V,0,5)
:If {V*4+L5}=1
:X->{V*4+L5+1}
:Y->{V*4+L5+2}
:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2
:2->{V*4+L5}
:R->{V*4+L5+3}
:End
:End
:For(V,0,5)
:If {V*4+L5}=2
:If {V*4+L5+3}
:{V*4+L5+1}+2->{V*4+L5+1}
:Else
:{V*4+L5+1}-2->{V*4+L5+1}
:End
:Pt-On({V*4+L5+1},{V*4+L5+2},Pic2
:End
:End
:For(V,0,5)
:If {V*4+L5+1}>90
:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}
:Return
:End
:End
:If T < S
:T++
:End
:For(V,0,5)
:For(P,0,3)
If abs({V*4+L5+1}-{P*2+L1})<6
If abs({V*4+L5+2}-{P*2+L1+1})<6
:{P+L2}--
:0->{V*4+L5}+100->{V*5+L5+1}->{V*5+L5+2}
End
End
End
End
End
DispGraph
End




1675
Axe / Re: Axe Q&A
« on: November 30, 2011, 05:15:14 pm »
Question... What is Y0

1676
TI Z80 / Re: Fullrene
« on: November 30, 2011, 05:09:51 pm »
I cant get it to work.

I have
#Axiom(FULLRENE)
Fcdf(1)
.Code
Lbl C
Repeat getKey(9)
.Text
If getKey(15)
sub(SAVE)
Fcdf(0)
Return
End
End
Fcdf(0)
Return
.More code

1677
General Calculator Help / Re: NEED HELP GETTING GAMES!!!
« on: November 29, 2011, 10:50:12 pm »
You posted a link to omnimaga, on a topic that's on omnimaga?!

1678
TI Z80 / Re: Grappler!
« on: November 29, 2011, 10:41:39 pm »
ERROR FIXED!! :w00t: :w00t:
Quote from: M. Bison
YYYESSS!! YYESSSS!

The error was simply screwing up ends. I'm going to start programming the computer with indents :P

Now that The Game actually functions, I can now see how the grappling is performing. Conclusion after playing: my grappling curves are unbelievably unrealistic. So, now progress can resume! :w00t:

:w00t:

I solved it by trying builderboy's idea. His idea was to make is displae value of a Var before the problem. When the Text( never worked, I realized that there must be something before where I thought the problem was.

The problem was that once H reached 3, it didn't work. I never closed an end in the right spot so the if H>1 was acutally nested in a if H=2.

1679
Axe / Re: Axe Q&A
« on: November 29, 2011, 09:18:53 pm »
Things that really should work but don't?  O.O
SITUATION = GRAPPLER :(
According to the result of my gameplay, 3 is apparently not between 2 and 40 D:

The only difference is that I don't have a due date  >:D

But seriously.... Hope it gets fixed  ;D

I can't look at it now since I have homework still left  :banghead: :banghead:

1680
TI Z80 / Re: Absolute Madness
« on: November 29, 2011, 07:45:20 pm »
Where's the E?

Pages: 1 ... 110 111 [112] 113 114 ... 161