Programming on the Raspberry Pi – Program in python

How to create a window in Python 2.7:

  1. Open Python 2.7 (Idle) from the programming menu and type in the following:

import pygame

pygame.init()

screen = pygame.display.set_mode([640, 480])

pygame.display.set_caption(“Hello Python World!”)

NOTE: You can change the title to whatever you want the window to be called.

Save and press F5 on the keyboard.

Our Window:

hellopythonworld!

Enjoy!

Epic Chas Gamer 🙂

 

PS: SMASH THAT LIKE BUTTON!

PS: for a full screen windows then do the line pygame.display.set_mode([640, 480], a comma and then enter, then pygame.FULLSCREEN).

 

 

Setting up your Raspberry Pi

Get your Pi set up in eight easy steps:

  1. Purchase a Pi by searching up ‘Buy a Raspberry Pi’ and buying one from a website.
  2. You could choose to buy a Pi 2, or 3 or B+ if you want a head start. Be more advanced by getting a Pi A+, A or Zero. Or you could just buy a normal Pi Model B.
  3. Get a keyboard, mouse and Wi-fi dongle. (Pi 3 has built in Wi-Fi and Bluetooth 4.1, so you won’t need a dongle if using a Pi 3.) Pi 2 and B+ have 4 USB ports so you can plug in a dongle without a USB hub. Pi A+, A and B users must use a powered USB hub (unless Model B users use an ethernet cable to connect.) Pi Zero Users will need a Micro USB to USB adapter and then plug the hub in.
  4. Get a HDMI cable and hook the Pi up to the TV using it. You will need a TV as well. (Tip: Pi Zero Users need a Micro HDMI to HDMI cable to connect their Pi to the TV.
  5. Get a power supply (a mobile phone charger will do) to power the Pi. Please note the Pi needs a certain amount of power.
  6. An SDcard. Pi A+, B+, 2, 3 and Zero require MicroSD cards. Otherwise, you will need a full size. I recommend an 8GB at the very least.
  7. Plug the SD/microSD card into the PC (via an SD adapter if needed) and go to raspberrypi.org/downloads and download the NOOBS zip file and unzip it onto the SD/microSD card. Then eject the SD/microSD card and slot it into the Pi. Then plug in the TV power supply and the power supply, switch the TV on and then switch the power supply on.
  8. Then when NOOBS loads, choose Raspbian Jessie and Data Partion. Then click install.

PC Minecraft?

Jpeg

You can access Minecraft on the Pi easily, just click on Menu and click games, and click Minecraft Pi, but could you run PC Minecraft as the Pi runs Linux and Linux supports PC Minecraft? All of you readers can comment and tell me whether or not the Pi supports Minecraft PC. If you find out any ways then comment in and talk about it!

Epic Chas Gamer 🙂

UPDATE: I ran the launcher successfully but it gave me an error message when I clicked play. It seems like the Pi can’t run Minecraft PC. We will just have to cope with Pi Edition for now.

 

 

Teleporter for Minecraft Pi! Raspbian Jessie!!!!

I wanted to do a feature for Raspbian Jessie users for Minecraft Pi Teleporting.

My Wheezy Teleporter is here: https://coolchasgamer.wordpress.com/2016/05/23/teleporter-for-minecraft-pi-raspbian-wheezy-tutorial/

The Jessie Teleporter:

Make a new file called teleporter.py in /home/Pi and copy the following text and post it into geany (type gksu into LXTerminal and then type apt-get install geany if you don’t have geany yet) once the file teleporter.py has been opened. Save and press run once Minecraft has been opened and a new world has been created inside it.

The code is as followed:

from mcpi.minecraft import Minecraft

from time import sleep

mc = Minecraft.create()

x, y, z = mc.player.getPos()

sleep(5)

mc.postToChat(“Teleporting in 3s”)

sleep(1)

mc.postToChat(“2s”)

sleep(1)

mc.postToChat(“1s”)

sleep(1)

mc.postToChat(“Wooooooooooo!”)

mc.setPos(x, y+1000, z)

 

Now press F5 on the keyboard.

Enjoy!

Epic Chas Gamer 😂

 

Teleporter for Minecraft Pi! Raspbian Wheezy Tutorial!

Use a teleporter in Minecraft Pi on Raspbian Wheezy by opening LXTerminal and typing cd mcpi/api/python/mcpi and then typing in nano teleporter.py.

The code is below.

from minecraft import Minecraft

from time import sleep

mc = Minecraft.create()

x, y, z = mc.player.getPos()

sleep(5)

mc.postToChat(“Teleporting in 3s”)

sleep(1)

mc.postToChat(“2s”)

sleep(1)

mc.postToChat(“1s”)

sleep(1)

mc.postToChat(“Wooooooooooo!”)

mc.setPos(x, y+1000, z)

Then press CTRL + O, and then save as teleporter.py. Then once on a world on Minecraft, go to LXTerminal and type python teleporter.py. Enjoy!

Epic Chas Gamer 🙂

TNT Trail!

Today on Minecraft Pi Edition I programmed a TNT trail. You walk around after the code has been ran, and TNT appears! Ignite some! Please note that not all the TNT is ignitable but the unignitable TNT still blows up when ignitable TNT blows up.

Copy and paste the code into Geany (or your preferred Python environment) and run it. Make sure you are on a world on Minecraft and hit the TNT that appears each step. Press CTRL +C in your Python environment to stop the TNT trail.

The code is here:

from mcpi.minecraft import Minecraft
from time import sleep

mc = Minecraft.create()
x, y, z = mc.player.getPos() # player position (x, y, z)
this_block = mc.getBlock(x, y, z) # block ID
print(this_block)
tnt = 46

while True:
x, y, z = mc.player.getPos() # player position (x, y, z)
block_beneath = mc.getBlock(x, y-1, z) # block ID

if block_beneath == tnt:
mc.setBlock(x, y, z, tnt, 1)
sleep(0.1)
else:
mc.setBlock(x, y-1, z, tnt)
Enjoy!

Epic Chas Gamer 🙂

 

 

 

 

 

Raspbian Jessie, NOOBS and Raspberry Pi 3!

Jpeg

Today I got my RPi 3 and was SOOOOOOOOOOOOOOOOOOOOOOOO excited to see what was new. I inserted a microSD card with NOOBS on it. Then Raspbian Jessie acually worked and booted. It was slow at first but booted. I was logged in automaticly as pi and when Jessie’s interface loaded I was sooooo excited! LibreOffice! Minecraft! Internet! Sonic Pi! Much More!

To set up Raspbian Jessie in the cool way, open up the Terminal and type

sudo apt-get update

sudo apt-get install synaptic

sudo apt-get install geany

sudo apt-get install libvte9

Voila! You just installed some software. Synaptic is in the preferences menu, Geany in the Programming and libvte9 is a good package for the geany terminal tab if it isn’t in geany’s message window. It doesn’t always appear, but keep the package.

Go to programming, click Sonic Pi and type ‘mc_message”Hello World of Minecraft Pi Edition”‘. Then launch up Minecraft Pi, in the Games section and create a new world. Then click TAB on the keyboard.  Then on Sonic Pi, press Run. Click on the open tab Minecraft and you will see your message.

 

UPDATED:

Raspbian Jessie’s latest version has geany pre-installed

 

Minecraft Pi Edition

Hello!

I will show you how to get Minecraft Pi installed on a Raspi.

Note: If you have Raspbian Jessie, Minecraft is already installed.

For Raspbian Wheezy:

1. Open Dillo

2. Visit pi.minecraft.net, click the link and choose where to extract the files. Once done, go to the mcpi folder and click on minecraft-pi and click execute. Click start game, followed by create new.

Move with the WSAD keys and jump with space. Left click to mine/attack. Use the scroll wheel (or the numbers) to select the items in the hotbar. E will load the inventory and ESC will load the pause menu.

Jpeg

Minecraft-pi can also be programmed. Posts about programming Minecraft Pi in the future.

Enjoy!

Epic Chas Gamer 😀

 

 

Epic Chas Gamer skin for MCPE

Skin by Epic Chas Gamer.

autosave-2-1-1

Enjoy!

Epic Chas Gamer 😀

To change your skin, launch up Minecraft PE and click skins. After downloading the skin, click custom and then navigate to the folder of the skin. Click on the skin and choose a skin model (Steve or Alex). Enjoy!

MCPE Sky-Glide!

I guess that is what it is called, anyway.

Step 1:

Build a high tower out of any block. Go up to any height you want, I am going for the max (128 blocks).

Screenshot_2016-05-14-10-45-57

Screenshot_2016-05-14-10-46-13

Screenshot_2016-05-14-10-46-30

Step 2.

Crouch and jump. Then click on the up button

Screenshot_2016-05-14-10-46-49

Screenshot_2016-05-14-10-47-03

Step 3. Move away from the tower of blocks. You can now glide around. Simply press on down to go down and go down to land to land on the ground. Press crouch to stop crouching.

Enjoy!

Epic Chas Gamer 🐕