Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
85. Yeah man :) It has the nice feel of a new world, lots of open space, humming with potential. The only downside I've found so far is that rough bit when you're first starting, and you don't want to be too close to each other, but you need to go a ways to find things in world (ideally that haven't already been looted...) and the dubious joy of dying a long way away when you're looking for things. My friends are also building their base together, so there's effectively only 2 bases going to be happening!
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
80 God. That API sounds horrific. It sounds like using a turtle might be easier, and that's impressive.
86 Actually, there where some things I forgot.
Sprites: To work with sprites you first need to create a new class extending pygames sprite class. Not really a problem, except during development they didn't even get as far as functions when we started let alone classes and objects, we are also not done yet.

After you made your sprite object you need a way to render it. This is by making a new sprite group object and putting the sprite in this group. Then you can call the groups "draw" function. The only upside is that groups have an "update" function that you can call which then calls each update function of each sprite. However, as there is no update loop by default you still end up needing to call each update from each group by hand anyway.

Another fun one is working with text. To do this you first need to create a font object. After you have done this you can make a text surface using this font and after you have done that you need to put it at the correct location and "blit" it to the screen. Also, pygame doesn't like new lines and you will have to write support for those yourself if you want to use them.

Also, take a look at this function from the mixer API
Code:
play(Sound, loops=0, maxtime=0, fade_ms=0) -> None
You write down how often you want it to loop, rather then how many times you want it to play. Meaning that it is just asking for off by one errors
Code:
play(someSound,5) #will play 6 times
It isn't as big as an WTF as the other stuff but..... it isn't exactly ideal either......

As you can probably guess, I'm happy I won't have to deal with pygame again (at least, I hope)
 
C

Closet Gamer

Guest
85. Yeah man :) It has the nice feel of a new world, lots of open space, humming with potential. The only downside I've found so far is that rough bit when you're first starting, and you don't want to be too close to each other, but you need to go a ways to find things in world (ideally that haven't already been looted...) and the dubious joy of dying a long way away when you're looking for things. My friends are also building their base together, so there's effectively only 2 bases going to be happening!
88 That's so cool, I love it. I played on a server once, just me and two other people. Typically very quiet, hadn't seen a soul for days but every now and then you'd get a glimpse of civilization. One day I logged on and I had a mine cart track running through my house! Then one of the guys wizzed past me in cart xD so funny... and the zombie in a present prank we spoke about before. Brilliant.

------------------------
My Age of Engineering Series: http://www.youtube.com/playlist?list=PLUZaEaeCvlj6ChY3jks-N8rW74_3qEtmD
 
  • Like
Reactions: GamerwithnoGame

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
89. Hah! :D Excellent. I don't know if this will make it to Christmas (I rather doubt it) but there may well be pranks across the year - if so, I'll share the stories!
 
  • Like
Reactions: Closet Gamer

duckfan77

Popular Member
Mar 18, 2013
80
683
118
90
Another fun one is working with text. To do this you first need to create a font object. After you have done this you can make a text surface using this font and after you have done that you need to put it at the correct location and "blit" it to the screen. Also, pygame doesn't like new lines and you will have to write support for those yourself if you want to use them.

Also, take a look at this function from the mixer API
Code:
play(Sound, loops=0, maxtime=0, fade_ms=0) -> None
You write down how often you want it to loop, rather then how many times you want it to play. Meaning that it is just asking for off by one errors
Code:
play(someSound,5) #will play 6 times
It isn't as big as an WTF as the other stuff but..... it isn't exactly ideal either......

As you can probably guess, I'm happy I won't have to deal with pygame again (at least, I hope)

I mean, off by one errors are going to happen no mater what, so that isn't that big an issue.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
90


I mean, off by one errors are going to happen no mater what, so that isn't that big an issue.
91 maybe, but this is just asking about those errors.
Also, as I'm complaining about pygame anyway, lets also complain a bit about python. Why do its build in data structures all have other interfaces to work with them?
For example to add something to a set, a dictionary or a list you have
Code:
list.append(newValue)
set.add(newValue)
dictionary["newKey"] = newValue
newTuple = (*oldTuple, newValue)
Now, I'm ok with the fact that you add stuff differently to a dictionary as opposed to a list or set. But is it really needed to have different function names to add stuff to a list or a set? As for the tuple. those are meant to be read only, so that code just unpacks it and makes a new tuple with the new value at the end, fair enough.

And combining stuff isn't exactly much better, for a set you need to use extend, for a dictionary you use update and for a set you need to use union which returns a new set and for tuples you just add them together like you would for numbers.