Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

PyGame (Ball-E) error

Hi!

I am trying to implement a pygame in OS, so that participants can play this game after they finished completing a survey.

The game is Ball-E, taken from here: https://www.pygame.org/project/1072/1916

The survey works fine, but the game does not. Once I press on the button I created for the game, the game flashes on the screen for a very short time and then i get the error message below.

Any help is much appreciated.

Cheers!


item-stack: survey[run].Games[run].Games_loop[run].Ball_e[run]

exception type: ValueError

exception message: subsurface rectangle outside surface area

item: Ball_e

time: Wed Oct 30 14:42:13 2019

phase: run


Traceback (also in debug window)


File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\inline_script.py", line 116, in run

self.workspace._exec(self.crun)

File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\base_python_workspace.py", line 124, in _exec

exec(bytecode, self._globals)

Inline script, line 191, in <module>

Inline script, line 178, in main

ValueError: subsurface rectangle outside surface area

Comments

  • Hi,

    Can you share your experiment here? Then we might able to get to the bottom of what is going awry here.

    Eduard

    Buy Me A Coffee

  • Hi,

    Thanks for the reply!

    I've uploaded a simple version of the survey. To advance, please use the space bar and/or fill in the information required. :)

    Paula

  • edited November 2019

    Later edit: deleted.

  • Hi Paula,

    sorry for the delay. Does your last post mean the problem is resolved?

    Thanks,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    No: unfortunately, I was not able to solve it.

    Any input would be much appreciated.

    Paula

  • edited November 2019

    Hi Paula,

    I looked at your code and I found the problem. However, as I don't know how this game is supposed to work exactly, and the code is too complex to get it just from looking at it, I can't fix it for you. So, I can describe it, and you have to figure out yourself what to do about it.

    The issue is that the surface rotatedhas a different size than the rectangle subrect  (newimg = rotated.subsurface(subrect)

    # these are the sub rect dimensions
    <rect(-34, -33, 84, 83)>
    # these are the rotated dimensions
    <rect(0, 0, 16, 16)>
    

    If you want to create a subsurface of a surface (rotated), it must be contained (maybe even the same) as the parent surface. So, basically your script scrashes because you want to create a subsurface of an object that lies outside its scope. To fix it, you have to make the subrect be contained in rotated. Whether you better change one or the other, I can't tell you.

    Does that make sense?

    I upload a version of the game, in which I arbitrarily changed the surfaces and could make the screen appear. Whether the game works as you wish it to work, I don't know (lines that I changed are 181-187

    .


    Best,

    Eduard

    Buy Me A Coffee

  • Hi Eduard,

    Thank you VERY much for your help.

    Your fix worked perfectly just by keeping the change you made in lines 181-187.

    Cheers,

    Paula

  • I edited the script a bit more and in the end managed to enlarge the subsurface to get a larger ball image based on your explanation.

    Thanks again for the help!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games