Posts

Showing posts with the label games

Python and Farseer: 2d Physics in Silverlight

Silverlight is a Microsoft browser plugin competing with Flash for rich internet applications and games (amongst other things). The most interesting thing about Silverlight, to me at any rate, is that it allows client-side web applications that run in the browser to be written in IronPython - including full access to the browser DOM. Silverlight is now maturing, with version 3.0 released only recently. Silverlight runs natively on Windows and the Mac on Firefox, Safari and Internet Explorer browsers. The Mono version for Linux, Moonlight , has reached the level of compatibility where it is capable of running DLR applications - like my IronPython examples . There are now lots of interesting open source libraries for developing Silverlight applications. One of them is the Farseer Physics Engine : The Farseer Physics Engine is an easy to use 2D physics engine designed for Microsoft’s XNA and Silverlight platforms. The Farseer Physics Engine focuses on simplicity, useful features, and en...

Getting started with IronPython – Part 4: MiniMax algorithm

Dror Helper continues his series on getting started with IronPython programming. He has been creating an example game and after his last entry on unit testing he moves onto adding some simple AI logic: Getting started with IronPython – Part 4: MiniMax algorithm As part of my quest to learn how to program in Python I’ve decided to implement a simple Minimax algorithm. The algorithm is simple and relies on a elementary principle – each turn you will choose the best move and your opponent will choose the worst move for you. By building a search tree with a limited depth we can then choose each time either the maximum result possible or the minimum result according to the player’s turn. You can read more about Minimax algorithm in Wikipedia – or continue reading and learn it from my implementation.

Getting Started with IronPython - Part 2: Let's write some code

A follow up from Part 1: where to start , this is a blog entry by Dror Helper on starting programming with IronPython. This entry mainly explores Python the language; including exceptions, classes, methods and magic methods. He has set himself the task of implementing a version of the Mancala board game . Getting Started with IronPython - Part 2: Let's write some code Playing Mancala is easy: The board has two stores (also called Mancala) one for each player and the goal of the game is to collect as many stones as possible. remark – if you don’t see the stores in the board above don’t worry my board doesn’t have any. instead I keep the seeds/stones won at the sides of the board . Each player has six pots he can play from (the ones closer to his side) in the board above my side is the six lower pots. Players alternate turns, in his turn a player choose one of his pots, takes all of the stones from that pot and places them one by one on every pot he passes in counter clockwise order....

John Conway's Game of Life in XAML/WPF using embedded Python

Daniel Paull has an implementation of John Conway's Game of Life (cellular automata) written with XAML/WPF (Windows Presentation Foundation - a Microsoft UI library built on top of DirectX) and using embedded Python scripts. John Conway's Game of Life in XAML/WPF using embedded Python Following on from my series on embedding DLR scripts in XAML, I present an implementation of John Conway's Game of Life in XAML/WPF using embedded Python scripts. The game is loaded completely from loose XAML. Even the initial game state is defined in dynamically loaded XAML files! The game is hosted in the very dynamic application described in a previous post. The Game of Life is played by calculating successive generations of the board. We add a button to calculate the next generation. A simple implementation of the Game of Life is written in the Python script. The button's DataContext is bound to the board, allowing the script to retrieve the board from the button.

Game Scripting in IronPython

Calbert has written a MUD type game with C# and IronPython on the server, with the user interface in Silverlight. " I wanted to explore this scripting for Perenthia because I want to be able to add dynamic functions or scripts to objects. I wrote this sample to test out using C# as base classes for IronPython classes and passing operations back and forth between the two. As such the source is kind of loose but the concepts are demonstrated. What I have is a basic framework of C# classes that define an Actor (any object in the game), a Client (a connected player), a Game (the logic of the game) and a Server (for handling HTTP communication, etc.). The Actor, Client and Game classes also server as the base classes for IronPython classes or Creatures, NPCs, Players and Rooms. " In his blog entry he shows some of the C# classes and how they are used from IronPython. Game Scripting in IronPython Play Cameron's Dungeon Cameron's Dungeon Source Code (6mb)

Games Programming with IronPython and OpenTk

There are lots of good options for games programming with CPython, so it is nice to also have choices for IronPython. One .NET framework for games programming that boasts of working well with IronPython is "OpenTk". OpenTk - the Open Toolkit The Open Toolkit is a game development library for .Net/Mono with an elegant, yet powerful, API. It enables you to bring your ideas to fruition, leveraging the full power of .Net, OpenGL and OpenAL. OpenTK needs no setup. It runs on Linux and Windows and works with all .Net languages, like C#, VB.Net and IronPython. Best of all, it is - and will remain! - free for both commercial and non-commercial projects. This is OpenGL like you've never seen it before.

OpenSimulator Python Scripting via realXtend

This is all new to me, but it looks really interesting. This is a blog post introducing the new 'Open Simulator' planet aggregator, and the work of realXtend. Hello World, New features & Introducing RealXtend OpenSimulator is an Open Source Application Platform which can be used for creating immersive 3D Virtual Interactive Environments such as Virtual worlds. According to the blog entry they have had a lot of work contributed by realXtend : Creating an open source platform for interconnected virtual worlds is the goal of realXtend project. We collaborate with OpenSim, OpenViewer and realXtend viewer projects. Their work includes: On the serverside, RealXtend have implemented some nifty features such as Python scripting support (via IronPython)

Hephaestus Games Engine replacing Lua with IronPython

Pirogoth, one of the developers of the Hephaestus Games Engine , blogs about the decision to change their development languages: IronPython will replace Lua as the scripting language C# will replace C++ The examples of the C++/Lua rendering engine output are amazing, so it will be interesting to see what they can achieve moving to the .NET platform over the coming months. http://torquedev.blogspot.com/2008/02/changes-in-air.html

Quiz: Can you count how many combinations...

Mike Stall moves on from calculating army sizes with IronPython, and uses it to answer quiz puzzles... Quiz: Can you count how many combinations...

More IronPython Posts

There have been a few more IronPython related posts recently: Battle Simulation Part 3: Size vs Smarts - Mike Stall does it again Simple DLR Language - A simple calculator language implemented with the Dynamic Language Runtime IronPython in Action, ConfigObj and doctests - News on the latest and coming chapters of "IronPython in Action" Changing the Default Browser with IronPython - Monkeying with the registry to change the default browser from IronPython Chasing Memory Leaks in Python Applications - How a problem in the IronPython implementation caused a hard to trace memory leak in Resolver One Anti-Pattern: Static Subject to Observer Mapping - Kamil's explanation of the anti-pattern that caused the memory leak

Battle Simulations with IronPython (Part 2)

Mike Stall continues his exploration of modeling RTS battles with IronPython. More code and graphs! Battle Simulations with IronPython (Part 2)

Get values from Wii Remote (through IronPython and WiimoteLib.dll)

This is an English translation of the Japanese blog entry I linked to last week on using the managed Wii remote interface from IronPython: Get values from Wii Remote (through IronPython and WiimoteLib.dll)

Age of Empires Battle simulation with IronPython

Mike Stall has been using IronPython to simulate Age of Empires archer battles. Discussion, code and charts! RTS Battle simulation with IronPython

Using the Wiimote from IronPython

Another one in Japanese I'm afraid, but again the code is clear. This blog entry shows how to use WiimoteLib , a Managed Library for Nintendo's Wiimote, from IronPython: Using the Wiimote from IronPython