Author Topic: RoboGun: My first big axe game  (Read 24822 times)

0 Members and 1 Guest are viewing this topic.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #45 on: November 07, 2011, 06:06:20 pm »
K. Let me just run upstairs.

Edit: How much code?
« Last Edit: November 07, 2011, 06:12:51 pm by epic7 »

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #46 on: November 07, 2011, 06:21:47 pm »
one that controls bullet?
Sig wipe!

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #47 on: November 07, 2011, 06:39:12 pm »
I think this is everything that is relevant to the bullets

Code: [Select]
:55→S→T
:8→O
:2→I

:For(V,0,I)
:0→{V*5+L5}
:0→{V*5+L5+3}
:End

:.Main Loop
:Repeat getKey(25)
:.All the other getkeys
:If getKey(54)
:If T=S
:For(V,0,I)
:!If {V*5+L5}
:1→{V*5+L5}
:0→T
:Goto X
:End
:End
:End
:End
:Lbl X
:If R
:Pt-On(X,Y,L*8+Pic1)
:Else
:Pt-On(X,Y,FlipH(L*8+Pic1)
:End
:For(V,0,I)
:If {V*5+L5}=1
:X+4→{V*5+L5+1}
:Y+1→{V*5+L5+2}
:Pt-On({V*5+L5+1},{V*5+L5+2},Pic2
:1→{V*5+L5+3}
:2→{V*5+L5}
:R→{V*5+L5+4}
:End
:End
:For(V,0,I)
:If {V*5+L5+3}
:If {V*5+L5+4}
:{V*5+L5+1}++
:Else
:{V*5+L5+1}--
:End
:Pt-On({V*5+L5+1},{V*5+L5+2},Pic2)
:End
:End
:For(V,0,I)
:If {V*5+L5+1}=1 or {V*5+L5+1}>90
:sub(SET)
:Goto I
:Lbl SET
:0→{V*5+L5}→{V*5+L5+3}+100→{V*5+L5+1}→{V*5+L5+2}
:Return
:Lbl I
:End
:End

:.Stuff

:If T<S
:T++
:End

:. Collision below
:For(V,0,I)
:For(P,0,C)
:If {P*3+L2+2}
:If abs({V*5+L5+1}-{P*2+L1})<6
:If abs({V*5+L5+2}-{P*2+L1+1})<6
:{P*3+L2}-O→{P*3+L2}
:sub(SET)
:End
:End
:End

:. Other stuff including enemy death code

:DispGraph
:End




Works fine except for the random bullet at the beginning....

And occasional enemy invincibility...
« Last Edit: November 07, 2011, 06:47:22 pm by epic7 »

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Robo-Gun: My first big axe game
« Reply #48 on: November 07, 2011, 09:21:32 pm »
Looks good:) can't wait to see it all debugged and such. do you want to see my mario shotgun game too see how I fixed my random bullet?
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #49 on: November 08, 2011, 10:00:32 pm »
Okay

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #50 on: November 09, 2011, 04:43:50 pm »
I put the shoot in the beginning of the main loop, but it still has the random bullet. Improved the game, mostly the upgrade menu.
In the gif, you'll see that my guns begin to look demented :P
« Last Edit: November 09, 2011, 04:45:03 pm by epic7 »

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #51 on: November 09, 2011, 04:52:36 pm »
:D Nice screenie!!!!
I +1ed XD

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Robo-Gun: My first big axe game
« Reply #52 on: November 09, 2011, 05:19:03 pm »
Here I'll post my Mario game so you can see how my bullets work.
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #53 on: November 10, 2011, 05:21:27 pm »
hm, if anyone's interested, I can post some code for a possible implementation of a rotation movement engine, something like the one in Base 671 (look in my sig)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Robo-Gun: My first big axe game
« Reply #54 on: November 10, 2011, 06:01:45 pm »
actually that code be useful!
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #55 on: November 10, 2011, 06:05:02 pm »
Cool yeah.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #56 on: November 10, 2011, 07:30:20 pm »
yeah that would be awesome butts! :D

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #57 on: November 10, 2011, 10:48:07 pm »
Okay, so basically you have a variable representing how much your character has rotated. I'll use F. You have two variables for position, X and Y, and two variables for direction, D and E. And you have a jump table (just a bunch of data organized in an optimized way) stored in GDB1.

Code: [Select]
.jump table goes here
Data(-3r,0r,-2r,-1r,-1r,-2r,0r,-3r,1r,-2r,2r,-1r,3r,0r,2r,1r,1r,2r,0r,3r,-1r,2r,-2r,1r)->GDB1

.vars
.facing left (0)
0->F
.start at 10,10
10->X->Y
.not moving
0->D->E

.let's get this party started
Repeat getkey(15)

.2nd moves forward
If getkey(54)
X+D->X
Y+E->Y
End

.Alpha moves backward
If getkey(48)
X-D->X
Y-E->Y
End

.turning right
If getkey(3)
F++
If F>11
0->F
End
End

.turning left
If getkey(2)
F--
If F<<0
11->F
End
End

.put the directions from the jump table into D and E
{F*2+GDB1}->D
{F*2+1+GDB1}->E

.draw the dude
ClrDraw
.who is a circle
Circle(X,Y,2)
.(a small circle)

.draw a tail
Line(X,Y,X-(D*3),Y-(E*3))

Dispgraph

End

That should work. If you want to make your own sprite table so your character isn't just a circle, you can draw some sprites and put a pointer to the start of the data in, let's say, Pic1, and you can use this:

Code: [Select]
Pt-On(X-4,Y-4,F*8+Pic1

(it's X-4,Y-4 and not X,Y because you want to center the sprite)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #58 on: November 10, 2011, 11:30:09 pm »
Cool, like a TD on yourself!! xD

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Robo-Gun: My first big axe game
« Reply #59 on: November 12, 2011, 06:05:09 pm »
I don't think I could use rotation for this project, though.