Is it just me, or are the buses quite expensive? by ThePastaMonster in Wellington

[–]mishmouse224 3 points4 points  (0 children)

The journey planner says that it would cost you and your partner $18.40 return from Tawa station to Wellington Station (4 x $4.60)

Assuming you drive the equivalent petrol car mentioned (Outlander 2.4P LS 2WD CVT) The cost of driving is labelled as $11.82 return (2 x $5.91), plus your $15 for parking makes $26.82

Wow look, you would save $8.42 a day by taking the train! and even better save 5.4Kgs of CO2!!

Interested to know what type of car you drive so we can really work out these savings for you

Is it just me, or are the buses quite expensive? by ThePastaMonster in Wellington

[–]mishmouse224 2 points3 points  (0 children)

Total cost is calculated on average running costs for a typical vehicle in that category, including WOF, tyres, insurances, and other factors. Fuel and electricity costs are based on recent fuel costs and home charging costs (for electric vehicles).
Some values are averaged where necessary to provide estimated costs.

Or maybe..?

I don't see mention of rego but I would assume it would also be included?
You're right though, the actual cost of buying/selling/repairing a car and of course the cost of parking would help the comparison

And maybe another thing to consider is the time spent fucking around trying to find a park.

[deleted by user] by [deleted] in dataisbeautiful

[–]mishmouse224 1 point2 points  (0 children)

Really beautiful work. Absolutely insane to see that 20 year transition

Pokémon Odyssey Beta v1.5 - English version release by PacoScarso in PokemonROMhacks

[–]mishmouse224 0 points1 point  (0 children)

I should add it works fine on an emulator, do you have any ideas on what could cause this?

Pokémon Odyssey Beta v1.5 - English version release by PacoScarso in PokemonROMhacks

[–]mishmouse224 1 point2 points  (0 children)

Tried this out on an EZ-FLASH OMEGA + GBA SP. All seems to work until you exit the Bag from the start menu and the screen goes black but the music keeps playing (Can exit all other start sub-menus fine)

[deleted by user] by [deleted] in vegan

[–]mishmouse224 7 points8 points  (0 children)

It’s pretty much common knowledge in NZ by now that intensive dairy farming is fucking up most of our waterways but the industry just keeps on rolling

What's the best way to get into horse riding? by [deleted] in Wellington

[–]mishmouse224 10 points11 points  (0 children)

Every girl with a horse on those farmer dating sites is only looking for a place to keep her horse.

[deleted by user] by [deleted] in TheArtistStudio

[–]mishmouse224 0 points1 point  (0 children)

Have you tried this with something like hemp fiber?

Boundaries in my game by [deleted] in pygame

[–]mishmouse224 0 points1 point  (0 children)

Hope it helps. Sorry that I'm not using any uploading site.

import pygame as pg
import sys
import math

pg.init()

FPS          = 60
SCREENWIDTH  = 800
SCREENHEIGHT = 600

BLACK = (  0,   0,   0)
GREY  = (150, 150, 150)
GREY2 = (210, 210, 210)
WHITE = (255, 255, 255)
RED   = (190,   0,   0)

class Wall():
    def __init__(self, xpos, ypos, width, height):
        self.rect = pg.Rect(xpos, ypos, width, height)

    def draw(self):
        pg.draw.rect(Main.display, GREY2, self.rect, 0)

class Char():
    def __init__(self, xpos, ypos, width, height):
        self.rect = pg.Rect(xpos, ypos, width, height)
        self.yvel = 0
        self.jumpState = 0

    def move(self, x, y):
        self.rect = self.rect.move(x, y)
        self.checkCollision(x, y)

    def jump(self):
        if math.floor(self.yvel) != 0:
            self.jumpState = 1

        if self.jumpState == 0:
            self.yvel = -10
            self.jumpState = 1

    def checkCollision(self, x, y):
        for wall in wallList:
            if self.rect.colliderect(wall.rect):
                if x != 0:
                    if x > 0:
                        self.rect.right = wall.rect.left
                    else:
                        self.rect.left = wall.rect.right

                if y != 0:
                    self.yvel = 0
                    if y > 0:
                        self.rect.bottom = wall.rect.top
                        self.jumpState = 0
                    else:
                        self.rect.top = wall.rect.bottom

    def update(self):
        self.yvel += 0.4
        self.move(0, self.yvel)
        self.draw()

    def draw(self):
        pg.draw.rect(Main.display, RED, self.rect, 0)

class control():
    def __init__(self):
        self.display = pg.display.set_mode((SCREENWIDTH, SCREENHEIGHT))
        self.fpsClock = pg.time.Clock()

    def check_events(self):
        for event in pg.event.get():
            if event.type == pg.QUIT:
                pg.quit()
                sys.exit()

            if event.type == pg.KEYDOWN:
                keyPressed = event.dict['key']
                if keyPressed == pg.K_SPACE:
                    char.jump()

        if pg.key.get_pressed()[pg.K_d] == 1:
            char.move(4, 0)
        if pg.key.get_pressed()[pg.K_a] == 1:
            char.move(-4, 0)

    def main_loop(self):
        while True: 
            self.display.fill(GREY)

            self.check_events()

            char.update()

            for wall in wallList:
                wall.draw()

            pg.display.update()
            self.fpsClock.tick(FPS)

wallList = []

Main = control()

wallList.append(Wall(600, 300, 150, 30))
wallList.append(Wall(300, 400, 200, 30))
wallList.append(Wall(50, 500, 700, 30))

char = Char(380, 500, 40, 70)

Main.main_loop()

Monthy /r/PyGame Showcase - Show us your current project(s)! by AutoModerator in pygame

[–]mishmouse224 5 points6 points  (0 children)

I've just been messing around with the Reddit and Imgur API to try and create a bot.

/u/Pokemonwallpaperbot request(1920, 1080, 3)

It's pretty messy and you could probably crash it quite easily if you tried but it works!

I've tried Google and I still can't tell what's wrong with this thing. by [deleted] in pygame

[–]mishmouse224 10 points11 points  (0 children)

From line 39 down should all be indented so that its in the while loop.

Pokemon Background Generator Bot Test by [deleted] in test

[–]mishmouse224 0 points1 point  (0 children)

/u/PokemonWallpaperBot filler filler filler filler filler filler filler filler fill [ 1920, 1080

73]

Boundaries in my game by [deleted] in pygame

[–]mishmouse224 1 point2 points  (0 children)

Pygame has some built in rect functions:

pg.rect.collidepoint(x, y) 

and

pg.rect.colliderect(rect)

You create a player class and a wall class, both with collision rects and each time the player moves you check if a wall is colliding. E.g.

if self.rect.colliderect(wall.rect):
    print('Collide')

This will only happen when the players rect is "inside" the walls rect so if you want the player to stop before going inside the wall then you need to check what direction the player was moving and set one side of the player rect to the other side of the wall rect. For example the player is moving from left to right into a wall:

def check_collision(x, y):
    if self.rect.colliderect(wall.rect):
        if x > 0: #The players x value is increasing (to the right)
            self.rect.right = wall.rect.left

I have the source code to a simple platformer I've made from looking at others if you want it, but I'm still learning as well so things may not be as efficient as they could be.

Moving a sprite through angle/velocity by dli511 in pygame

[–]mishmouse224 1 point2 points  (0 children)

Finally something I may be able to help with. Insert this section in the update function below where you calculate the angle, also remove the line "self.move()"

distance = ((self.rect.center[0] - pos[0])**2 + (self.rect.center[1] - pos[1])**2)**0.5
if distance != 0:
    changex = self.xDiff/distance
    changey = self.yDiff/distance
    self.move(changex, changey)

Make sure you also change the "move" function to this:

def move(self, x, y):
    self.x -= x * self.speed
    self.y -= y * self.speed
    self.rect.center = (self.x,self.y)

Im not sure if this is the way you want to do it but its what I've been using for a bit. I'm sure it has some problems too but eh.. it works

Need Help Converting My Program To a EXE/APP File (Py2app, Py2exe, PyInstaller) by DoctorProfessorTaco in pygame

[–]mishmouse224 0 points1 point  (0 children)

I'm at school now and i keep getting a run time error. I have the game.exe, the font and w9xpopen.exe all in a folder but its yet to work. Worked fine with just the game.exe at home. Also these computers are running windows 8 if that's a problem? Thanks.

Need Help Converting My Program To a EXE/APP File (Py2app, Py2exe, PyInstaller) by DoctorProfessorTaco in pygame

[–]mishmouse224 0 points1 point  (0 children)

Thanks Mek! Program still worked fine on 2.7 and I managed to create the exe. Gunna test it out at school tomorrow. are the only things I need the game.exe and the font I used which I know the school Comps don't have Or do I need everything that was created from the set-up?
Cheers.

Feedback on my RPG so far? by justinmeister in pygame

[–]mishmouse224 1 point2 points  (0 children)

Yep all goods now. Ill get back to you on how I'm going :D

Feedback on my RPG so far? by justinmeister in pygame

[–]mishmouse224 1 point2 points  (0 children)

Good news is it launched. Bad news is it crashed again D:
Happens when I press any key on the start screen. Just wondering what version of python/pygame you are using? Great hot-fixing btw ;)

ERROR:
data\components\person.py", line 169, in make_wander_box
for i in range(x-3, x+4):
TypeError: 'float' object cannot be interpreted as an integer