Game app
class Character:
def init(self, name, element, weapon):
self.name = name
self.element = element
self.weapon = weapon
self.stats = {
"attack": random.randint(50, 100),
"defense": random.randint(30, 80),
"speed": random.randint(20, 70)
}
self.effects = {}
def add_effect(self, effect_name, percentage):
self.effects[effect_name] = percentage
def display_character(self):
print(f"Name: {self.name}")
print(f"Element: {self.element}")
print(f"Weapon: {self.weapon}")
print("Stats:")
for stat, value in self.stats.items():
print(f" {stat.capitalize()}: {value}")
print("Special Effects:")
for effect, percentage in self.effects.items():
print(f" {effect.capitalize()}: {percentage}%")
Character creation inputs
print("Create your character:")
name = input("Enter character name: ")
print("Choose an element: [Fire, Water, Lightning, Earth, Poison, Chakra, etc.]")
element = input("Enter element: ")
weapon = input("Choose your weapon: [Sword, Gun, Magic Staff, etc.] ")
Generate character
player = Character(name, element, weapon)
print("\nCharacter created! Add special effects to your weapon.")
Adding special effects
while True:
effect = input("Enter special effect (type 'done' to finish): ")
if effect.lower() == 'done':
break
percentage = int(input(f"Enter percentage for {effect}: "))
player.add_effect(effect, percentage)
Drake Anthony Bourque - Universal Hub
Patent Number: DAB-12345678
Contact: drakeBourque19@gmail.com | goat@ohsofresh.store
Phone: (337) 258-7863
<h3>Explore and Support:</h3>
<ul>
<li><a href="https://www.oh-so-fresh.com/" target="_blank">Visit My Store</a></li>
<li><a href="https://temp-szopnicvwhvbdbqrcryh.webadorsite.com/development" target="_blank">My Development Projects</a></li>
<li><a href="https://cash.app/$DABsDevelopment" target="_blank">Support on Cash App</a></li>
<li><a href="https://paypal.me/DrakeBourque" target="_blank">Support on PayPal</a></li>
<li><a href="https://liveoauth.com/" target="_blank">LiveOAuth Integration</a></li>
</ul>
<h3>Special Features:</h3>
<button onclick="window.location.href='https://www.oh-so-fresh.com/'" style="background-color: #4CAF50; color: white; padding: 10px 20px; border: none; cursor: pointer;">Go to Store</button>
<button onclick="window.location.href='https://liveoauth.com/'" style="background-color: #008CBA; color: white; padding: 10px 20px; border: none; cursor: pointer;">LiveOAuth Portal</button>
<footer style="margin-top: 15px; font-size: 12px; color: #555;">
© 2025 Drake Anthony Bourque. All rights reserved. This work is copyrighted and protected under law.
</footer>
Display the completed character
print("\nYour Character:")
player.display_character()
import random
class Character:
def init(self, name, element, weapon):
self.name = name
self.element = element
self.weapon = weapon
self.stats = {
"attack": random.randint(50, 100),
"defense": random.randint(30, 80),
"speed": random.randint(20, 70)
}
self.effects = {}
def add_effect(self, effect_name, percentage):
self.effects[effect_name] = percentage
def display_character(self):
print(f"Name: {self.name}")
print(f"Element: {self.element}")
print(f"Weapon: {self.weapon}")
print("Stats:")
for stat, value in self.stats.items():
print(f" {stat.capitalize()}: {value}")
print("Special Effects:")
for effect, percentage in self.effects.items():
print(f" {effect.capitalize()}: {percentage}%")
Simulate an App Store Pop-Up
def app_store_popup(character):
print("\n=== App Store ===")
print("Upgrade your character with these premium features:")
print("1. Increase Attack by 20%")
print("2. Increase Defense by 15%")
print("3. Add Special Effect: Fire Elemental Boost (50%)")
print("4. Add Special Effect: Poison Resistance (30%)")
print("5. Exit Store")
while True:
choice = input("Enter the number of the feature you'd like to purchase (or '5' to exit): ")
if choice == '1':
character.stats['attack'] += int(character.stats['attack'] * 0.2)
print("Attack increased by 20%!")
elif choice == '2':
character.stats['defense'] += int(character.stats['defense'] * 0.15)
print("Defense increased by 15%!")
elif choice == '3':
character.add_effect("Fire Elemental Boost", 50)
print("Added special effect: Fire Elemental Boost (50%)")
elif choice == '4':
character.add_effect("Poison Resistance", 30)
print("Added special effect: Poison Resistance (30%)")
elif choice == '5':
print("Exiting App Store...")
break
else:
print("Invalid choice. Please try again.")
Character creation inputs
print("Create your character:")
name = input("Enter character name: ")
print("Choose an element: [Fire, Water, Lightning, Earth, Poison, Chakra, etc.]")
element = input("Enter element: ")
weapon = input("Choose your weapon: [Sword, Gun, Magic Staff, etc.] ")
Generate character
player = Character(name, element, weapon)
print("\nCharacter created! Add special effects to your weapon.")
Adding special effects
while True:
effect = input("Enter special effect (type 'done' to finish): ")
if effect.lower() == 'done':
break
percentage = int(input(f"Enter percentage for {effect}: "))
player.add_effect(effect, percentage)
Display the completed character
print("\nYour Character:")
player.display_character()
Trigger the App Store pop-up
app_store_popup(player)
Final character display after App Store upgrades
print("\nYour Upgraded Character:")
player.display_character()
from flask import Flask, request, jsonify
import random
app = Flask(name)
class Character:
def init(self, name, element, weapon):
self.name = name
self.element = element
self.weapon = weapon
self.stats = {
"attack": random.randint(50, 100),
"defense": random.randint(30, 80),
"speed": random.randint(20, 70)
}
self.effects = {}
def add_effect(self, effect_name, percentage):
self.effects[effect_name] = percentage
def to_dict(self):
return {
"name": self.name,
"element": self.element,
"weapon": self.weapon,
"stats": self.stats,
"effects": self.effects
}
@app.route('/create_character', methods=['POST'])
def create_character():
data = request.json
character = Character(data['name'], data['element'], data['weapon'])
return jsonify(character.to_dict())
@app.route('/add_effect', methods=['POST'])
def add_effect():
data = request.json
effect_name = data['effect_name']
percentage = data['percentage']
# Fetch character from database or session (mocked here)
character = Character("MockedName", "Fire", "Sword")
character.add_effect(effect_name, percentage)
return jsonify(character.to_dict())
if name == 'main':
app.run(host='0.0.0.0', port=5000)
<title>Game Client</title>
Create Your Character
Name:
Element:
Weapon:
Create Character
<h1>Add Special Effects</h1>
<form id="effectForm">
<label for="effect_name">Effect Name:</label>
<input type="text" id="effect_name" name="effect_name"><br>
<label for="percentage">Percentage:</label>
<input type="number" id="percentage" name="percentage"><br>
<button type="button" onclick="addEffect()">Add Effect</button>
</form>
<div id="output"></div>
<script>
async function createCharacter() {
const name = document.getElementById('name').value;
const element = document.getElementById('element').value;
const weapon = document.getElementById('weapon').value;
const response = await fetch('http://localhost:5000/create_character', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ name, element, weapon })
});
const data = await response.json();
document.getElementById('output').innerText = JSON.stringify(data, null, 2);
}
async function addEffect() {
const effect_name = document.getElementById('effect_name').value;
const percentage = document.getElementById('percentage').value;
const response = await fetch('http://localhost:5000/add_effect', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ effect_name, percentage })
});
const data = await response.json();
document.getElementById('output').innerText = JSON.stringify(data, null, 2);
}
</script>
from flask import Flask, request, jsonify
import random
app = Flask(name)
class Character:
def init(self, name, element, weapon):
self.name = name
self.element = element
self.weapon = weapon
self.stats = {
"attack": random.randint(50, 100),
"defense": random.randint(30, 80),
"speed": random.randint(20, 70)
}
self.effects = {}
def add_effect(self, effect_name, percentage):
self.effects[effect_name] = percentage
def to_dict(self):
return {
"name": self.name,
"element": self.element,
"weapon": self.weapon,
"stats": self.stats,
"effects": self.effects
}
@app.route('/create_character', methods=['POST'])
def create_character():
data = request.json
character = Character(data['name'], data['element'], data['weapon'])
return jsonify(character.to_dict())
@app.route('/add_effect', methods=['POST'])
def add_effect():
data = request.json
effect_name = data['effect_name']
percentage = data['percentage']
# Fetch character from database or session (mocked here)
character = Character("MockedName", "Fire", "Sword")
character.add_effect(effect_name, percentage)
return jsonify(character.to_dict())
if name == 'main':
app.run(host='0.0.0.0', port=5000)
var GameIntegration = pc.createScript('gameIntegration');
// Initialize the script
GameIntegration.prototype.initialize = function() {
this.createCharacter("PlayerOne", "Fire", "Sword");
};
// Create Character Function
GameIntegration.prototype.createCharacter = function(name, element, weapon) {
var xhr = new XMLHttpRequest();
var url = 'http://YOUR_SERVER_IP:5000/create_character'; // Replace with your server's IP and port
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
console.log('Character created:', JSON.parse(xhr.responseText));
}
};
var data = JSON.stringify({"name": name, "element": element, "weapon": weapon});
xhr.send(data);
};
// Add Special Effect Function
GameIntegration.prototype.addEffect = function(effectName, percentage) {
var xhr = new XMLHttpRequest();
var url = 'http://YOUR_SERVER_IP:5000/add_effect'; // Replace with your server's IP and port
xhr.open('POST', url, true);
xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
console.log('Effect added:', JSON.parse(xhr.responseText));
}
};
var data = JSON.stringify({"effect_name": effectName, "percentage": percentage});
xhr.send(data);
};
Please sign in to leave a comment.
I only put a little bit code I’m pretty much for the whole platform or environment. I put it into those websites because those websites are like a portal, they obtained data data can help push the servers well at least with my logic