Posts

finale update

Image
 When I started the project backup I started by adding an attack radius to the base tower. I also set it up to toggle show the radius which will be use to open the menu to upgrade,   I've added on the code for the enemy class enemy(QGraphicsRectItem,QTimer): def __init__ ( self ,parent= None ): super (enemy, self ). __init__ (parent) self .setRect( 0 , 75 , 75 , 75 ) self .check = 0 def move ( self ): while self .x()< 400 : self .setPos( self .x() + 100 , self .y()) self .check = 1 temp = enemy() temp.singleShot( 1000 ,temp,temp.move) scene.addItem(temp) this code is supposed to make it move and it is more finished than last time it was seen.  I found out why my code just stopped working the file somehow corrupted, but the code inside was fine so I grabbed a older version of the same code I had emailed to my self and copy and pasted the new stuff into it.

Day 7

Image
 I am trying to set up the move function  It isn't working and gives error

Day 6

 Today I started a few things I started making enemies and the start button to start the round here is the current code for both class enemy(QGraphicsRectItem,QTimer): def __init__ ( self ): self .setRect( 0 , 75 , 75 , 75 ) def timerEvent ( self , a0): if self .timeout == true: self .setPos( self .x()+ 5 , self .y()) class startButton(widgets.QPushButton): def __init__ ( self ): if

Day 5

Image
 Today I added the attack radius And the basis for the menu system and I plan to add enemies next

Day 4

 I found a video tutorial for the c++ version of QT but since Qt c++ and pyQt/Pyside are essentialy the same this works fine for me. here is the link  qt tutorial  I also found out that i hadn't installed everything I needed from the offical  PyQT/Pyside  page.

Day 3

 Today I finished the drag drop function and look at a tutorial that can help me set the attack range.

Day 2

Image
 I copied all of my all code that I had made previously what was originally there the original code import PySide6 import PySide6.QtCore as core import PySide6.QtGui as gui import PySide6.QtWidgets as widgets from PySide6.QtWidgets import QGraphicsScene,QGraphicsView,QGraphicsRectItem,QGraphicsSceneMouseEvent,QGraphicsItem,QGraphicsEllipseItem from PySide6.QtGui import QDragMoveEvent,QCursor from PySide6.QtCore import QEvent, Qt, QPointF,QPoint import sys class Store ( QGraphicsRectItem,QGraphicsEllipseItem,QGraphicsSceneMouseEvent ) : def __init__ ( self , parent = None ) : super ( Store, self ) . __init__ ( parent ) self . setAcceptHoverEvents ( True ) self . setRect ( 650 , 0 , 75 , 75 ) def mousePressEvent ( self , event : PySide6.QtWidgets.QGraphicsSceneMouseEvent ) : self .tower = Tower ( 650 , 0 ) scene. addItem ( self .tower ) def mouseMoveEvent ( self , event ) : og_cursor_pos = event . lastScenePos () new...