Imagine this: you are an artist in Venice, Italy and overwhelmed with clients eager to have their portraits painted on a serene gondola ride, you programmed a little robot friend, Mosaic Droid, to assist you in bringing your pixel-art visions to life.
Mosaic Droid is an application that interprets a specialized programming language, enabling it to paint pixels onto a digital canvas.
This application allows you to write commands in a text editor or load them from .pw files. Mosaic Droid will then execute these commands sequentially, drawing lines, circles, and rectangles, changing brush colors and sizes, and even filling areas with color. You'll manage variables, utilize functions, and implement conditional jumps to control the flow of your artistic program.
Key functionalities include:
- Drawing Primitives: Commands like
DrawLine,DrawCircle, andDrawRectangleallow Mosaic Droid to create fundamental shapes on the canvas. - Color and Size Control: Adjust Wall-E's brush with
ColorandSizecommands to achieve different artistic effects. - Fill Functionality: The
Fill()command intelligently paints contiguous areas of the same color. - Variable Assignment: Assign numerical or boolean values to variables for dynamic program control.
- Built-in Functions: Utilize functions like
GetActualX(),GetActualY(),GetCanvasSize(),GetColorCount(),IsBrushColor(),IsBrushSize(), andIsCanvasColor()to retrieve information and make decisions within your code. - Conditional Jumps: Implement
GoTostatements with labels and conditions to create loops and branching logic, allowing for complex artistic patterns.
- User-Friendly Interface (WPF): A modern graphical interface built with WPF, featuring a text editor with line numbers, a dynamic canvas, and intuitive controls.
- Language Localization (.NET Resources): Seamlessly switch the application's language between English and Spanish for a fully customizable experience.
- Background Music with Mute/Unmute: Enjoy an immersive experience with optional background music, controllable via dedicated mute/unmute buttons.
- Information Panel: A helpful panel on the right side of the interface provides a quick guide to all available commands and their syntax, aiding users in programming Wall-E.
- Canvas Customization: Easily adjust the canvas dimensions to your preference, with a button to resize.
- Code Execution and Error Handling: Execute your pixel art code with a dedicated button. The application will smartly report syntactic and semantic errors, and gracefully capture and report runtime errors, stopping execution while preserving the painted progress.
- File Management: Load existing
.pwfiles into the editor and save your current code to.pwfiles for later use.
- Launch the application: Run the executable file.
- Select your language: Choose between English and Spanish using the language switching option.
- Adjust Canvas Dimensions: Input your desired canvas size (e.g., 256 for a 256x256 pixel canvas) and click the "Redimensionar Canvas" (Resize Canvas) button.
- Write Your Code: Use the text editor on the left to write your commands.Remember, every valid code must start with
Spawn(x,y). - Execute Your Art: Click the "Ejecutar Código" (Execute Code) button to see Mosaic Droid bring your pixel art to life on the canvas.
- Load/Save Projects: Use the "Cargar Archivo" (Load File) and "Guardar Archivo" (Save File) buttons to manage your
.pwproject files. - Control Music: Use the music control buttons to mute or unmute the background music.
- Refer to the Information Panel: If you need a reminder of the language commands, consult the information panel on the right side of the interface.
- Example Code Execution:
- Error Reporting:
- Language Switch:
- Clone this repository:
git clone [https://github.com/MenwaLab/Project2PixelWallE] - Install .NET SDK: If not already installed, download and install .NET 9.0 from the official Microsoft website.
- Restore NuGet Packages: Navigate to the project directory in your terminal and run
dotnet restoreto install all necessary dependencies, including WPF-related packages and .NET Resource Management. - Open the project: Open the
.slnfile in your preferred IDE (e.g., Visual Studio). - Run the project: Build and run the project from your IDE.
- C#
- WPF (Windows Presentation Foundation)
- .NET Resource Management
Special thanks to my professors and the teacher assistants at The University of Havana for their unwavering support. This project, "Pixel Wall-E," represents my second programming project in the Computer Science major, offering an interesting dive into programming concepts and UI frameworks.
- Author: Meylí
- Email: [meylijv@gmail.com]
- GitHub: [https://github.com/MenwaLab]