December 23, 2024, 05:29:38 am

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Wondering where all the forums have gone?

Join the community Discord server!

Pages: 1 ... 8 9 [10] 11 12 ... 77

Author Topic: Official PyGG2 Development thread  (Read 161099 times)

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #135 on: September 12, 2011, 10:55:04 am »

No you didn't, the code you pasted there has tabs not spaces
I still changed the options.
well, fix your code. maybe you confused tab width and tabs to spaces
Or maybe you just read portions of code that I wrote before. :/

Look at the collision response.
Logged

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #136 on: September 12, 2011, 12:34:51 pm »

No you didn't, the code you pasted there has tabs not spaces
I still changed the options.
well, fix your code. maybe you confused tab width and tabs to spaces
Or maybe you just read portions of code that I wrote before. :/

Look at the collision response.
well fix the old code, inconsistency is the issue here
Logged

HUNT3R

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 92
  • LEET™
Re: Porting GG2 to another Language - New Thread
« Reply #137 on: September 12, 2011, 08:09:50 pm »

Hey today was my first day of Programming class and we're going to learn Python a lot throughout the year

We learned loops, strings, Boolean objects (mostly did Pythonkara), functions/def?

I have a question, how do you know how how much indenting to do? Thats the only hard part so far.

I hope in 5 months or so to know enough to help you guys out with this.
Logged
LEET™

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #138 on: September 13, 2011, 01:41:31 am »

Hey today was my first day of Programming class and we're going to learn Python a lot throughout the year

We learned loops, strings, Boolean objects (mostly did Pythonkara), functions/def?

I have a question, how do you know how how much indenting to do? Thats the only hard part so far.

I hope in 5 months or so to know enough to help you guys out with this.
How much indenting?

Official is half a tab, or 4(?) spaces.
Normally you can configure your IDE/Text editor to do it when you hit tab.


And for one lesson you already learned a lot. Keep going.
Logged

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #139 on: September 13, 2011, 01:42:54 am »

Identing is simple, you increase after a colon, and decrease at the end of the block.
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #140 on: September 13, 2011, 10:07:12 am »

PyGG2 v0.1.5;

-Fixed a few minor bugs of the collision code
-Added a weapon class, a scattergun class and a scattergun sprite
-Added a function "point_direction" (this took a while)
-Made a character turn to face the mouse
« Last Edit: September 13, 2011, 10:07:36 am by Orpheon »
Logged

Psychopath

  • Developer In Training
  • ******
  • Karma: 167
  • Offline Offline
  • Posts: 6682
  • Stop telling me to do things
Re: Porting GG2 to another Language - New Thread
« Reply #141 on: September 13, 2011, 10:20:18 am »

-Made a character turn to face the mouse

Don't forget that certain animations will require exceptions to that such as the eating and stabbing animations (and taunt animations if you want to prevent people from spinning around while taunting).
Logged
Quote from: IRC
(8:01:46 PM) Psychopath: I'm just wondering what the next hot thing to fall on my lap will be
(8:01:57 PM) Lynn1: a girl maybe?
(8:02:01 PM) Psychopath: :o

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #142 on: September 13, 2011, 12:26:19 pm »

-Made a character turn to face the mouse

Don't forget that certain animations will require exceptions to that such as the eating and stabbing animations (and taunt animations if you want to prevent people from spinning around while taunting).
Exceptions can easily be added later. And yes, I want to be able to change direction while taunting.

Also, I'd be really happy if someone could make the gun point to the mouse.
I made the function point_direction, the problem is the rotating sprite of course grows, but this isn't compensated by the draw positions.

Could someone please do this?
Logged

HUNT3R

  • Junior Member
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 92
  • LEET™
Re: Porting GG2 to another Language - New Thread
« Reply #143 on: September 13, 2011, 11:01:23 pm »

Code: [Select]

while not kara.treeFront():
  kara.move()
  break
while kara.treeFront():
  kara.putLeaf() and kara.move()
       

That's my code. I'll define it later.

The problem is when I execute it, the "ladybug" moves 1 space and stops. I want it to move forward when tree not in front and put leaf if tree in front.

later I'm going to try to turn right if tree in front.

Do you see any problems with this code guys? :/ I had a few problems with the "break" so I just increased the indent until it didn't give me a syntax error.

What is a syntax error anyway?
Logged
LEET™

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #144 on: September 14, 2011, 01:46:42 am »

A syntax error means bad syntax: like grammar or puncutation.
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #145 on: September 14, 2011, 04:13:23 am »

"break" means "exit the while loop". Your code won't work like that.

Try:

Code: [Select]
while True:
    while no kara.treeFront():
        kara.move()

    kara.turnRight()
Logged

notajf

  • Guest
Re: Porting GG2 to another Language - New Thread
« Reply #146 on: September 14, 2011, 01:58:26 pm »

oh crap orpheon didn't merge my changes
now my git is messed up

:(
Logged

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #147 on: September 15, 2011, 07:35:50 am »

I have a simple problem which for some reason I can't solve:

Making the weapon rotate to face the mouse.

I already made a perfectly working point_direction function, so that's not the problem. No, my problem is using pygame.transform.rotate in a way that the gun looks natural.
You need to fiddle a lot with offsets which I'm not too sure about.

Can anyone help?
Logged

Dusty

  • 2012 Haxxy Award Winner
  • *
  • Karma: -78
  • Offline Offline
  • Posts: 10312
  • Dust in a box under a table
Re: Porting GG2 to another Language - New Thread
« Reply #148 on: September 15, 2011, 08:48:32 am »

It feels weird, being able to watch this happen

Orpheon

  • Moderator
  • *****
  • Karma: 15
  • Offline Offline
  • Posts: 6409
  • Developer
Re: Porting GG2 to another Language - New Thread
« Reply #149 on: September 15, 2011, 09:31:30 am »


Me having fun.

I'll commit in a few minutes.

Also, you might have noticed that the gun still doesn't rotate. I need help.
« Last Edit: September 15, 2011, 09:39:05 am by Orpheon »
Logged
Pages: 1 ... 8 9 [10] 11 12 ... 77
 

Page created in 0.026 seconds with 36 queries.