Si vous tournez sous WordPress avec Jetpack, vous avez sûrement vu débarquer l'AI Assistant d'Automattic sans rien demander à personne. Un bouton IA qui se pointe dans l'éditeur, des suggestions générées un peu partout, un machin pour générer des vidéos à partir d'articles et le tout activé d'office, même sur les comptes gratuits.
Le pire, c'est que ça reste à moitié verrouillé derrière un abonnement payant qu'on vous colle sous le nez, avec seulement 20 malheureuses requêtes gratuites avant de devoir sortir la carte bleue. Donc autant dire qu'on peut rien tester que c'est déjà plié. Du coup, ça encombre l'interface pour rien comme ici :
Et pour le virer proprement depuis les réglages... bah y'a pas, forcement.
Vous pouvez toujours aller bidouiller dans les modules Jetpack un par un, l'assistant IA, lui, reste accroché comme une moule à son rocher. Croyez-moi, j'ai tout exploré et la seule vraie solution tient en une seule ligne. Vous l'ajoutez via un plugin comme Code Snippets, ou directement dans un fichier mu-plugins ou functions.php de votre thème si vous êtes à l'aise avec le code :
add_filter( 'jetpack_ai_enabled', '__return_false' );
Et hop, toutes les fonctionnalités IA de Jetpack dégagent d'un coup, y compris la fameuse bulle de chat dans l'éditeur. C'est le hook officiel, documenté chez Jetpack depuis la version 11.8, donc rien de bricolé là-dedans. C'est juste que vous coupez le robinet à conneries à la source.
Maintenant, si toucher au PHP vous file de l'urticaire, sachez qu'il existe aussi un petit plugin baptisé Turn Off AI Features qui fait exactement le même boulot avec un simple interrupteur. C'est un peu la même chose que quand on débranche l'IA imposée de Windows 11 , afin de reprendre la main sur sa propre machine.
Quand on voit que Firefox a réussi à mettre un seul bouton pour tout couper, on se dit qu'Automattic pourrait faire un effort.
![]()
Pick up parts of a spaceship, fuel it up, and take off in Mark Vanstone’s Python and Pygame Zero rendition of a ZX Spectrum classic
The original Jetpac, in all its 8-bit ZX Spectrum glory
For ZX Spectrum owners, there was something special about waiting for a game to load, with the sound of zeros and ones screeching from the cassette tape player next to the computer. When the loading screen – an image of an astronaut and Ultimate Play the Game’s logo – appeared, you knew the wait was going to be worthwhile. Created by brothers Chris and Tim Stamper in 1983, Jetpac was one of the first hits for their studio, Ultimate Play the Game. The game features the hapless astronaut Jetman, who must build and fuel a rocket from the parts dotted around the screen, all the while avoiding or shooting swarms of deadly aliens.
This month’s code snippet will provide the mechanics of collecting the ship parts and fuel to get Jetman’s spaceship to take off. We can use the in-built Pygame Zero Actor objects for all the screen elements and the Actor collision routines to deal with gravity and picking up items. To start, we need to initialise our Actors. We’ll need our Jetman, the ground, some platforms, the three parts of the rocket, some fire for the rocket engines, and a fuel container. The way each Actor behaves will be determined by a set of lists. We have a list for objects with gravity, objects that are drawn each frame, a list of platforms, a list of collision objects, and the list of items that can be picked up.
Jetman jumps inside the rocket and is away. Hurrah!
Our draw() function is straightforward as it loops through the list of items in the draw list and then has a couple of conditional elements being drawn after. The update() function is where all the action happens: we check for keyboard input to move Jetman around, apply gravity to all the items on the gravity list, check for collisions with the platform list, pick up the next item if Jetman is touching it, apply any thrust to Jetman, and move any items that Jetman is holding to move with him. When that’s all done, we can check if refuelling levels have reached the point where Jetman can enter the rocket and blast off.
If you look at the helper functions checkCollisions() and checkTouching(), you’ll see that they use different methods of collision detection, the first being checking for a collision with a specified point so we can detect collisions with the top or bottom of an actor, and the touching collision is a rectangle or bounding box collision, so that if the bounding box of two Actors intersect, a collision is registered. The other helper function applyGravity() makes everything on the gravity list fall downward until the base of the Actor hits something on the collide list.
So that’s about it: assemble a rocket, fill it with fuel, and lift off. The only thing that needs adding is a load of pesky aliens and a way to zap them with a laser gun.
Here’s Mark’s Jetpac code. To get it running on your system, you’ll need to install Pygame Zero. And to download the full code and assets, head here.
You can read more features like this one in Wireframe issue 40, available directly from Raspberry Pi Press — we deliver worldwide.
And if you’d like a handy digital version of the magazine, you can also download issue 40 for free in PDF format.
![]()
Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to newsstand pricing!
The post Code Jetpac’s rocket building action | Wireframe #40 appeared first on Raspberry Pi.